Package net.shibboleth.shared.spring.custom

# Class SchemaTypeAwareBeanDefinitionDocumentReader

java.lang.Object
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
net.shibboleth.shared.spring.custom.SchemaTypeAwareBeanDefinitionDocumentReader

All Implemented Interfaces:
  `BeanDefinitionDocumentReader`

Direct Known Subclasses:
  `EmbeddedAndSchemaAwareReader`

public class SchemaTypeAwareBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocumentReader
An extension to the standard `DefaultBeanDefinitionDocumentReader` that uses a `SchemaTypeAwareBeanDefinitionParserDelegate` delegate for processing bean definitions.

This class was extended, per IDP-1640, to hijack another bug in Spring's reader class that prevents imports that don't start with file:// from being handled as absolute file paths if they exist.

## Field Summary

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

`ALIAS_ATTRIBUTE, ALIAS_ELEMENT, BEAN_ELEMENT, IMPORT_ELEMENT, logger, NAME_ATTRIBUTE, NESTED_BEANS_ELEMENT, PROFILE_ATTRIBUTE, RESOURCE_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`SchemaTypeAwareBeanDefinitionDocumentReader()`

## Method Summary

Modifier and Type
Method
Description
`protected BeanDefinitionParserDelegate`
`createDelegate(XmlReaderContext readerContext, Element root, BeanDefinitionParserDelegate parentDelegate)`
`protected void`
`importBeanDefinitionResource(Element ele)`
This override prevents the default behavior from kicking in if the original resource location is directly usable by the installed `ResourceLoader`.

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

`doRegisterBeanDefinitions, extractSource, getReaderContext, parseBeanDefinitions, postProcessXml, preProcessXml, processAliasRegistration, processBeanDefinition, registerBeanDefinitions`

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

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

## Constructor Details

### SchemaTypeAwareBeanDefinitionDocumentReader

public SchemaTypeAwareBeanDefinitionDocumentReader()

## Method Details

### importBeanDefinitionResource

protected void importBeanDefinitionResource(@Nonnull Element ele)
This override prevents the default behavior from kicking in if the original resource location is directly usable by the installed `ResourceLoader`.

This is needed because Spring's internal behavior around imports unfortunately ignores the whole ResourceLoader hook. Arguably a bug.

Overrides:
  `importBeanDefinitionResource` in class `DefaultBeanDefinitionDocumentReader`

### createDelegate

@Nonnull protected BeanDefinitionParserDelegate createDelegate(@Nonnull XmlReaderContext readerContext, @Nonnull Element root, @Nullable BeanDefinitionParserDelegate parentDelegate)

Overrides:
  `createDelegate` in class `DefaultBeanDefinitionDocumentReader`