Class BaseAttributeValueMatcherParser

All Implemented Interfaces:
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 Details

  • 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.
      configElement - the config element to inspect
      whether here is a an attribute Id
    • getBeanClass

      @Nonnull protected Class<?> getBeanClass(@Nonnull Element element)
      The table at the top describes the precise work.
      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.

      doParse in class BaseFilterParser
    • getNativeBeanClass

      @Nonnull protected abstract Class<?> getNativeBeanClass()
      Method return the native Matcher implementation.
      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.
      element - the config
      parserContext - the context
      builder - the builder