Package net.shibboleth.idp.attribute.filter.spring.basic.impl

# Class ScriptedMatcherParser

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.basic.impl.ScriptedMatcherParser

All Implemented Interfaces:
  `BeanDefinitionParser`

public class ScriptedMatcherParser extends BaseFilterParser
Bean definition parser for `ScriptedPolicyRule` or `ScriptedMatcher` objects.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`static final QName`
`SCHEMA_TYPE`
Schema type.
`static final QName`
`SCRIPT_ELEMENT_NAME`
Inline Script element name.
`static final QName`
`SCRIPT_FILE_ELEMENT_NAME`
Script file element name.

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

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doParse(Element config, ParserContext parserContext, BeanDefinitionBuilder builder)`
Both types of bean take the same constructor, so the parser is simplified.
`protected Class<?>`
`getBeanClass(Element element)`

### 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

### SCHEMA_TYPE

@Nonnull public static final QName SCHEMA_TYPE
Schema type.

### SCRIPT_FILE_ELEMENT_NAME

@Nonnull public static final QName SCRIPT_FILE_ELEMENT_NAME
Script file element name.

### SCRIPT_ELEMENT_NAME

@Nonnull public static final QName SCRIPT_ELEMENT_NAME
Inline Script element name.

### log

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

## Constructor Details

### ScriptedMatcherParser

public ScriptedMatcherParser()

## Method Details

### getBeanClass

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

Overrides:
  `getBeanClass` in class `AbstractSingleBeanDefinitionParser`

### doParse

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

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.

Both types of bean take the same constructor, so the parser is simplified.

Overrides:
  `doParse` in class `BaseFilterParser`