Package org.opensaml.xmlsec.impl.provider

# Class ApacheSantuarioXMLParser

java.lang.Object
org.opensaml.xmlsec.impl.provider.ApacheSantuarioXMLParser

All Implemented Interfaces:
  `org.apache.xml.security.parser.XMLParser`

public class ApacheSantuarioXMLParser extends Object implements org.apache.xml.security.parser.XMLParser
Implementation of Santuario's `XMLParser` which simply wraps an instance of `ParserPool`.

Note:

- This class is required to have a no-arg constructor.
- It will fail on any calls where `disallowDocTypeDeclarations=false`.
- It is configured into Santuario by setting the class name using system property `org.apache.xml.security.XMLParser`. For details see: `XMLUtils`.
- By default it internally uses the registered global `ParserPool` from the `ConfigurationService`, if available. If not, then it constructs an internal instance of `BasicParserPool`.
- The internal parser pool's max pool size may be configured via OpenSAML `ConfigurationService` property ``CONFIG_PROPERTY_MAX_POOL_SIZE``. The default is: 50

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CONFIG_PROPERTY_MAX_POOL_SIZE`
Config property for internal pool's maxPoolSize.
`private final org.slf4j.Logger`
`log`
Logger.
`private final ParserPool`
`parserPool`
Wrapped instance of `ParserPool`.

## Constructor Summary

Constructors
Constructor
Description
`ApacheSantuarioXMLParser()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Document`
`parse(InputStream inputStream, boolean disallowDocTypeDeclarations)`

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

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

## Field Details

### CONFIG_PROPERTY_MAX_POOL_SIZE

@Nonnull @NotEmpty public static final String CONFIG_PROPERTY_MAX_POOL_SIZE
Config property for internal pool's maxPoolSize.

See Also:
  - Constant Field Values

### log

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

### parserPool

@Nonnull private final ParserPool parserPool
Wrapped instance of `ParserPool`.

## Constructor Details

### ApacheSantuarioXMLParser

public ApacheSantuarioXMLParser() throws InitializationException
Constructor.

Throws:
  `InitializationException` - if the internal `BasicParserPool` can not be initialized successfully

## Method Details

### parse

public Document parse(InputStream inputStream, boolean disallowDocTypeDeclarations) throws org.apache.xml.security.parser.XMLParserException

Specified by:
  `parse` in interface `org.apache.xml.security.parser.XMLParser`
Throws:
  `org.apache.xml.security.parser.XMLParserException`