Package org.opensaml.core.xml.config

# Class XMLObjectProviderRegistry

java.lang.Object
org.opensaml.core.xml.config.XMLObjectProviderRegistry

public class XMLObjectProviderRegistry extends Object
Configuration registry component for registering and retrieving implementation instances and related configuration relevant to working with XMLObjects, including builders, marshallers and unmarshallers.

The registry instance to use would typically be retrieved from the `ConfigurationService`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private XMLObjectBuilderFactory`
`builderFactory`
Configured XMLObject builder factory.
`private final Map<QName,Element>`
`configuredObjectProviders`
Object provider configuration elements indexed by QName.
`private static QName`
`defaultProvider`
Default object provider.
`private final Set<QName>`
`idAttributeNames`
Configured set of attribute QNames which have been globally registered as having an ID type.
`private org.slf4j.Logger`
`log`
Logger.
`private MarshallerFactory`
`marshallerFactory`
Configured XMLObject marshaller factory.
`private ParserPool`
`parserPool`
Configured parser pool.
`private UnmarshallerFactory`
`unmarshallerFactory`
Configured XMLObject unmarshaller factory.

## Constructor Summary

Constructors
Constructor
Description
`XMLObjectProviderRegistry()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`deregisterIDAttribute(QName attributeName)`
Deregister an attribute as having a type of ID.
`void`
`deregisterObjectProvider(QName key)`
Removes the builder, marshaller, and unmarshaller registered to the given key.
`XMLObjectBuilderFactory`
`getBuilderFactory()`
Gets the XMLObject builder factory that has been configured with information from loaded configuration files.
`QName`
`getDefaultProviderQName()`
Gets the QName for the object provider that will be used for XMLObjects that do not have a registered object provider.
`MarshallerFactory`
`getMarshallerFactory()`
Gets the XMLObject marshaller factory that has been configured with information from loaded configuration files.
`ParserPool`
`getParserPool()`
Get the currently configured ParserPool instance.
`UnmarshallerFactory`
`getUnmarshallerFactory()`
Gets the XMLObject unmarshaller factory that has been configured with information from loaded configuration files.
`boolean`
`isIDAttribute(QName attributeName)`
Determine whether a given attribute is registered as having an ID type.
`void`
`registerIDAttribute(QName attributeName)`
Register an attribute as having a type of ID.
`void`
`registerObjectProvider(QName providerName, XMLObjectBuilder<?> builder, Marshaller marshaller, Unmarshaller unmarshaller)`
Adds an object provider to this configuration.
`void`
`setParserPool(ParserPool newParserPool)`
Set the currently configured ParserPool instance.

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

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

## Field Details

### defaultProvider

@Nonnull private static QName defaultProvider
Default object provider.

### log

@Nonnull private org.slf4j.Logger log
Logger.

### configuredObjectProviders

@Nonnull private final Map<QName,Element> configuredObjectProviders
Object provider configuration elements indexed by QName.

### builderFactory

@Nonnull private XMLObjectBuilderFactory builderFactory
Configured XMLObject builder factory.

### marshallerFactory

@Nonnull private MarshallerFactory marshallerFactory
Configured XMLObject marshaller factory.

### unmarshallerFactory

@Nonnull private UnmarshallerFactory unmarshallerFactory
Configured XMLObject unmarshaller factory.

### idAttributeNames

@Nonnull private final Set<QName> idAttributeNames
Configured set of attribute QNames which have been globally registered as having an ID type.

### parserPool

@Nullable private ParserPool parserPool
Configured parser pool.

## Constructor Details

### XMLObjectProviderRegistry

public XMLObjectProviderRegistry()
Constructor.

## Method Details

### getParserPool

@Nullable public ParserPool getParserPool()
Get the currently configured ParserPool instance.

Returns:
  the currently ParserPool

### setParserPool

public void setParserPool(@Nullable ParserPool newParserPool)
Set the currently configured ParserPool instance.

Parameters:
  `newParserPool` - the new ParserPool instance to configure

### getDefaultProviderQName

@Nonnull public QName getDefaultProviderQName()
Gets the QName for the object provider that will be used for XMLObjects that do not have a registered object provider.

Returns:
  the QName for the default object provider

### registerObjectProvider

public void registerObjectProvider(@Nonnull QName providerName, @Nonnull XMLObjectBuilder<?> builder, @Nonnull Marshaller marshaller, @Nonnull Unmarshaller unmarshaller)
Adds an object provider to this configuration.

Parameters:
  `providerName` - the name of the object provider, corresponding to the element name or type name that the builder, marshaller, and unmarshaller operate on
  `builder` - the builder for that given provider
  `marshaller` - the marshaller for the provider
  `unmarshaller` - the unmarshaller for the provider

### deregisterObjectProvider

public void deregisterObjectProvider(@Nonnull QName key)
Removes the builder, marshaller, and unmarshaller registered to the given key.

Parameters:
  `key` - the key of the builder, marshaller, and unmarshaller to be removed

### getBuilderFactory

@Nonnull public XMLObjectBuilderFactory getBuilderFactory()
Gets the XMLObject builder factory that has been configured with information from loaded configuration files.

Returns:
  the XMLObject builder factory

### getMarshallerFactory

@Nonnull public MarshallerFactory getMarshallerFactory()
Gets the XMLObject marshaller factory that has been configured with information from loaded configuration files.

Returns:
  the XMLObject marshaller factory

### getUnmarshallerFactory

@Nonnull public UnmarshallerFactory getUnmarshallerFactory()
Gets the XMLObject unmarshaller factory that has been configured with information from loaded configuration files.

Returns:
  the XMLObject unmarshaller factory

### registerIDAttribute

public void registerIDAttribute(@Nonnull QName attributeName)
Register an attribute as having a type of ID.

Parameters:
  `attributeName` - the QName of the ID attribute to be registered

### deregisterIDAttribute

public void deregisterIDAttribute(@Nonnull QName attributeName)
Deregister an attribute as having a type of ID.

Parameters:
  `attributeName` - the QName of the ID attribute to be de-registered

### isIDAttribute

public boolean isIDAttribute(@Nonnull QName attributeName)
Determine whether a given attribute is registered as having an ID type.

Parameters:
  `attributeName` - the QName of the attribute to be checked for ID type.
Returns:
  true if attribute is registered as having an ID type.