Package net.shibboleth.idp.attribute.filter.spring.matcher

# Class BaseAttributeValueMatcherParser

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.filter.spring.BaseFilterParser
net.shibboleth.idp.attribute.filter.spring.matcher.BaseAttributeValueMatcherParser

All Implemented Interfaces:
  `BeanDefinitionParser`

Direct Known Subclasses:
  `AbstractRegexMatcherParser`, `AbstractStringMatcherParser`, `AttributeInMetadataRuleParser`, `ScopeMatchesShibMDScopeParser`, `ValueMatchesShibMDScopeParser`

public abstract class BaseAttributeValueMatcherParser extends BaseFilterParser
Base function for all Attribute Value matchers.

This function takes care of the bean nesting needed to convert the bean (which is a natural matcher) into the correct type. Specifically:

Bean Nesting
PolicyRule With Id | Nest inside a `PolicyFromMatcherId`
PolicyRule No Id | Nest inside a `PolicyFromMatcher`
Attribute Not Id | Native
Attribute ID Id | Nest inside a `PolicyFromMatcherId` inside a `MatcherFromPolicy`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ATTRIBUTE_ID`
ATTRIBUTE ID string.

### Fields inherited from class net.shibboleth.idp.attribute.filter.spring.BaseFilterParser

`AFP_ELEMENT_NAME, DENY_VALUE_RULE, NAMESPACE, PERMIT_VALUE_RULE, POLICY_REQUIREMENT_RULE, QUALIFIED_ID`

### 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
`BaseAttributeValueMatcherParser()`

## Method Summary

Modifier and Type
Method
Description
`protected abstract void`
`doNativeParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)`
Parse the native bean class.
`protected void`
`doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)`
Parse bean definition.
`protected Class<?>`
`getBeanClass(Element element)`
The table at the top describes the precise work.
`protected abstract Class<?>`
`getNativeBeanClass()`
Method return the native Matcher implementation.
`protected boolean`
`hasAttributeId(Element configElement)`
Helper function to determine if the Attribute Matcher has the attribute Id Specified.

### Methods inherited from class net.shibboleth.idp.attribute.filter.spring.BaseFilterParser

`getAbsoluteReference, getQualifiedId, isPolicyRule, parseCustomElements, resolveId`

### 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, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases`

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

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

## Field Details

### ATTRIBUTE_ID

@Nonnull public static final String ATTRIBUTE_ID
ATTRIBUTE ID string.

See Also:
  - Constant Field Values

## Constructor Details

### BaseAttributeValueMatcherParser

public BaseAttributeValueMatcherParser()

## Method Details

### hasAttributeId

protected boolean hasAttributeId(@Nonnull Element configElement)
Helper function to determine if the Attribute Matcher has the attribute Id Specified. This influences decisions both in parsing and in which bean to summon.

Parameters:
  `configElement` - the config element to inspect
Returns:
  whether here is a an attribute Id

### getBeanClass

@Nonnull protected Class<?> getBeanClass(@Nonnull Element element)
The table at the top describes the precise work.

Overrides:
  `getBeanClass` in class `AbstractSingleBeanDefinitionParser`

### doParse

protected void doParse(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nonnull BeanDefinitionBuilder builder)
Parse bean definition. If needs be we inject it into a parent bean (or two).

Calculate the qualified id once, and set both the id property as well as a qualified id metadata attribute used by the `BaseFilterParser.resolveId(Element, AbstractBeanDefinition, ParserContext)` method.

If we auto-generate a name then we issue a warning so users can (1) correct this, but also so they can make sense of the logging in the filters which uses the id extensively.

Overrides:
  `doParse` in class `BaseFilterParser`

### getNativeBeanClass

@Nonnull protected abstract Class<?> getNativeBeanClass()
Method return the native Matcher implementation.

Returns:
  the class.

### doNativeParse

protected abstract void doNativeParse(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nonnull BeanDefinitionBuilder builder)
Parse the native bean class. This is either called direct or indirectly and then injected into the nesting class.

Parameters:
  `element` - the config
  `parserContext` - the context
  `builder` - the builder