Class StAXDialectDetector
- java.lang.Object
-
- org.apache.axiom.util.stax.dialect.StAXDialectDetector
-
public class StAXDialectDetector extends Object
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
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static StAXDialectgetDialect(Class<?> implementationClass)Detect the dialect of a given StAX implementation.static StAXDialectgetDialect(XMLInputFactory factory)Detect the StAX dialect of a givenXMLInputFactoryinstance.static StAXDialectgetDialect(XMLOutputFactory factory)Detect the StAX dialect of a givenXMLOutputFactoryinstance.static XMLInputFactorynormalize(XMLInputFactory factory)Detect the dialect of a givenXMLInputFactoryand normalize it.static XMLOutputFactorynormalize(XMLOutputFactory factory)Deprecated.
-
-
-
Method Detail
-
normalize
public static XMLInputFactory normalize(XMLInputFactory factory)
Detect the dialect of a givenXMLInputFactoryand normalize it.- Parameters:
factory- the factory to normalize- Returns:
- the normalized factory
- See Also:
StAXDialect.normalize(XMLInputFactory)
-
normalize
public static XMLOutputFactory normalize(XMLOutputFactory factory)
Deprecated.Detect the dialect of a givenXMLOutputFactoryand normalize it.- Parameters:
factory- the factory to normalize- Returns:
- the normalized factory
- See Also:
StAXDialect.normalize(XMLOutputFactory)
-
getDialect
public static StAXDialect getDialect(Class<?> implementationClass)
Detect the dialect of a given StAX implementation.Note that to detect the StAX dialect of a given
XMLInputFactoryorXMLOutputFactoryinstance, 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,XMLStreamReaderorXMLStreamWriterimplementation- Returns:
- the detected dialect
-
getDialect
public static StAXDialect getDialect(XMLInputFactory factory)
Detect the StAX dialect of a givenXMLInputFactoryinstance.- Parameters:
factory- the factory instance- Returns:
- the detected dialect
-
getDialect
public static StAXDialect getDialect(XMLOutputFactory factory)
Detect the StAX dialect of a givenXMLOutputFactoryinstance.- Parameters:
factory- the factory instance- Returns:
- the detected dialect
-
-