Package net.shibboleth.idp.attribute.resolver.spring.enc

# Class BaseAttributeEncoderParser

java.lang.Object
org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
net.shibboleth.shared.spring.custom.AbstractCustomBeanDefinitionParser
net.shibboleth.idp.attribute.resolver.spring.enc.BaseAttributeEncoderParser

All Implemented Interfaces:
  `BeanDefinitionParser`

Direct Known Subclasses:
  `BaseSAML1AttributeEncoderParser`, `BaseSAML2AttributeEncoderParser`

public abstract class BaseAttributeEncoderParser extends AbstractCustomBeanDefinitionParser
Base class for Spring bean definition parser for attribute encoders.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Log4j logger.
`static final String`
`NAME_ATTRIBUTE_NAME`
Local name of name attribute.

### Fields inherited from class net.shibboleth.shared.spring.custom.AbstractCustomBeanDefinitionParser

`CUSTOM_PARSER_PROPERTIES_LOCATION`

### Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

`ID_ATTRIBUTE, NAME_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`BaseAttributeEncoderParser()`

## Method Summary

Modifier and Type
Method
Description
`protected abstract BeanReference`
`buildTranscoder()`
Return a bean definition for the transcoder to include in the mapping.
`protected abstract void`
`doParse(Element config, ParserContext parserContext, Map<String,Object> rule)`
Inject any necessary elements into the mapping rule based on the specific encoder type.
`protected void`
`doParse(Element config, ParserContext context, BeanDefinitionBuilder builder)`
`protected Class<TranscodingRule>`
`getBeanClass(Element element)`
`private void`
`processLocalizedElement(List<Element> elements, ManagedMap<String,Object> rule, String propertyPrefix)`
Used to process string elements that contain an xml:lang attribute expressing localization.
`protected boolean`
`shouldGenerateId()`
`protected boolean`
`shouldParseNameAsAliases()`

### Methods inherited from class net.shibboleth.shared.spring.custom.AbstractCustomBeanDefinitionParser

`getCustomProperty, registerBeanDefinition`

### Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser

`doParse, getBeanClassName, getParentName, parseInternal`

### Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

`parse, postProcessComponentDefinition, resolveId, shouldFireEvents, shouldGenerateIdAsFallback`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### NAME_ATTRIBUTE_NAME

@Nonnull @NotEmpty public static final String NAME_ATTRIBUTE_NAME
Local name of name attribute.

See Also:
  - Constant Field Values

### log

@Nonnull private final org.slf4j.Logger log
Log4j logger.

## Constructor Details

### BaseAttributeEncoderParser

public BaseAttributeEncoderParser()

## Method Details

### getBeanClass

@Nullable protected Class<TranscodingRule> getBeanClass(@Nonnull Element element)

Overrides:
  `getBeanClass` in class `AbstractSingleBeanDefinitionParser`

### shouldGenerateId

protected boolean shouldGenerateId()

Overrides:
  `shouldGenerateId` in class `AbstractBeanDefinitionParser`

### shouldParseNameAsAliases

protected boolean shouldParseNameAsAliases()

Overrides:
  `shouldParseNameAsAliases` in class `AbstractBeanDefinitionParser`

### doParse

protected void doParse(@Nonnull Element config, @Nonnull ParserContext context, @Nonnull BeanDefinitionBuilder builder)

Overrides:
  `doParse` in class `AbstractSingleBeanDefinitionParser`

### doParse

protected abstract void doParse(@Nonnull Element config, @Nonnull ParserContext parserContext, @Nonnull Map<String,Object> rule)
Inject any necessary elements into the mapping rule based on the specific encoder type.

Parameters:
  `config` - the encoder element being parsed
  `parserContext` - the parser context
  `rule` - the mapping rule

### buildTranscoder

@Nonnull protected abstract BeanReference buildTranscoder()
Return a bean definition for the transcoder to include in the mapping.

Returns:
  bean definition for an AttributeTranscoder

### processLocalizedElement

private void processLocalizedElement(@Nonnull List<Element> elements, @Nonnull ManagedMap<String,Object> rule, @Nonnull @NotEmpty String propertyPrefix)
Used to process string elements that contain an xml:lang attribute expressing localization.

Parameters:
  `elements` - list of elements, must not be null, may be empty
  `rule` - the map of rules to add to
  `propertyPrefix` - the root property name to install