Class StAXDialectDetector
java.lang.Object
org.apache.axiom.util.stax.dialect.StAXDialectDetector
Detects StAX dialects and normalizes factories for a given StAX implementation.
Note that this class internally maintains a cache of detected dialects. The overhead caused by invocations of methods in this class is thus small.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StAXDialect
getDialect
(Class<?> implementationClass) Detect the dialect of a given StAX implementation.static StAXDialect
getDialect
(XMLInputFactory factory) Detect the StAX dialect of a givenXMLInputFactory
instance.static StAXDialect
getDialect
(XMLOutputFactory factory) Detect the StAX dialect of a givenXMLOutputFactory
instance.static XMLInputFactory
normalize
(XMLInputFactory factory) Detect the dialect of a givenXMLInputFactory
and normalize it.static XMLOutputFactory
normalize
(XMLOutputFactory factory) Deprecated.
-
Method Details
-
normalize
Detect the dialect of a givenXMLInputFactory
and normalize it.- Parameters:
factory
- the factory to normalize- Returns:
- the normalized factory
- See Also:
-
normalize
Deprecated.Detect the dialect of a givenXMLOutputFactory
and normalize it.- Parameters:
factory
- the factory to normalize- Returns:
- the normalized factory
- See Also:
-
getDialect
Detect the dialect of a given StAX implementation.Note that to detect the StAX dialect of a given
XMLInputFactory
orXMLOutputFactory
instance, it is generally preferable to usegetDialect(XMLInputFactory)
orgetDialect(XMLOutputFactory)
instead of this method.- Parameters:
implementationClass
- any class that is part of the StAX implementation; typically this should be aXMLInputFactory
,XMLOutputFactory
,XMLStreamReader
orXMLStreamWriter
implementation- Returns:
- the detected dialect
-
getDialect
Detect the StAX dialect of a givenXMLInputFactory
instance.- Parameters:
factory
- the factory instance- Returns:
- the detected dialect
-
getDialect
Detect the StAX dialect of a givenXMLOutputFactory
instance.- Parameters:
factory
- the factory instance- Returns:
- the detected dialect
-