Package org.apache.axiom.om.util
Interface StAXParserConfiguration
-
public interface StAXParserConfiguration
Defines a particular StAX parser configuration. An implementation of this interface must satisfy the following requirements:- It MUST be immutable.
- It MUST either be a singleton or properly implement
Object.equals(Object)
andObject.hashCode()
.
- See Also:
StAXWriterConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description static StAXParserConfiguration
COALESCING
Configuration that sets up the parser in coalescing mode.static StAXParserConfiguration
DEFAULT
The default configuration.static StAXParserConfiguration
NON_COALESCING
Configuration that sets up the parser in non coalescing mode.static StAXParserConfiguration
PRESERVE_CDATA_SECTIONS
Configuration that sets up the parser to preserve CDATA sections.static StAXParserConfiguration
SOAP
Configuration suitable for SOAP messages.static StAXParserConfiguration
STANDALONE
Configuration that forces the parser to process the XML document as standalone.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description XMLInputFactory
configure(XMLInputFactory factory, StAXDialect dialect)
Apply the configuration to the given factory.
-
-
-
Field Detail
-
PRESERVE_CDATA_SECTIONS
static final StAXParserConfiguration PRESERVE_CDATA_SECTIONS
Configuration that sets up the parser to preserve CDATA sections. This configuration will also put the parser in non coalescing mode.
-
DEFAULT
static final StAXParserConfiguration DEFAULT
The default configuration. Same asPRESERVE_CDATA_SECTIONS
.
-
STANDALONE
static final StAXParserConfiguration STANDALONE
Configuration that forces the parser to process the XML document as standalone. In this configuration, the parser will ignore any references to external entities, in particular DTDs. This is especially useful to process documents referencing DTDs with system IDs that are network locations, because parsing these documents would otherwise fail on nodes detached from the network. This configuration should be used with care because the resulting representation of the document may be incomplete. E.g. default attribute values defined in the DTD will not be reported.
-
COALESCING
static final StAXParserConfiguration COALESCING
Configuration that sets up the parser in coalescing mode.
-
NON_COALESCING
static final StAXParserConfiguration NON_COALESCING
Configuration that sets up the parser in non coalescing mode.
-
SOAP
static final StAXParserConfiguration SOAP
Configuration suitable for SOAP messages. This will configure the parser to throw an exception when it encounters a document type declaration. The SOAP 1.1 specification indeed prescribes that "A SOAP message MUST NOT contain a Document Type Declaration." The difference between theSTANDALONE
configuration and this configuration is that withSTANDALONE
, the parser silently ignores references to external entities but doesn't throw any exception.
-
-
Method Detail
-
configure
XMLInputFactory configure(XMLInputFactory factory, StAXDialect dialect)
Apply the configuration to the given factory. The method MAY optionally wrap the factory, e.g. to modify the behavior of theXMLStreamReader
instances created by the factory.- Parameters:
factory
- the factory to configuredialect
- The dialect of the StAX implementation as detected byStAXDialectDetector
. The implementation may use this information to configure implementation specific settings.- Returns:
- The configured factory. This may be the original factory (if the implementation only changes the factory properties), or a wrapper.
-
-