org.apache.axiom.util.stax.dialect

## 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
    Modifier and Type | Method and Description
    --- | ---
    `static StAXDialect` | `getDialect(Class implementationClass)` Detect the dialect of a given StAX implementation.
    `static StAXDialect` | `getDialect(javax.xml.stream.XMLInputFactory factory)` Detect the StAX dialect of a given `XMLInputFactory` instance.
    `static StAXDialect` | `getDialect(javax.xml.stream.XMLOutputFactory factory)` Detect the StAX dialect of a given `XMLOutputFactory` instance.
    `static javax.xml.stream.XMLInputFactory` | `normalize(javax.xml.stream.XMLInputFactory factory)` Detect the dialect of a given `XMLInputFactory` and normalize it.
    `static javax.xml.stream.XMLOutputFactory` | `normalize(javax.xml.stream.XMLOutputFactory factory)` Detect the dialect of a given `XMLOutputFactory` and normalize it.

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

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

- - ### Method Detail

    - #### normalize

          public static javax.xml.stream.XMLInputFactory normalize(javax.xml.stream.XMLInputFactory factory)

      Detect the dialect of a given `XMLInputFactory` and normalize it.
      Parameters:
        `factory` - the factory to normalize
      Returns:
        the normalized factory
      See Also:
        `StAXDialect.normalize(XMLInputFactory)`

    - #### normalize

          public static javax.xml.stream.XMLOutputFactory normalize(javax.xml.stream.XMLOutputFactory factory)

      Detect the dialect of a given `XMLOutputFactory` and 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 `XMLInputFactory` or `XMLOutputFactory` instance, it is generally preferable to use `getDialect(XMLInputFactory)` or `getDialect(XMLOutputFactory)` instead of this method.

      Parameters:
        `implementationClass` - any class that is part of the StAX implementation; typically this should be a `XMLInputFactory`, `XMLOutputFactory`, `XMLStreamReader` or `XMLStreamWriter` implementation
      Returns:
        the detected dialect

    - #### getDialect

          public static StAXDialect getDialect(javax.xml.stream.XMLInputFactory factory)

      Detect the StAX dialect of a given `XMLInputFactory` instance.
      Parameters:
        `factory` - the factory instance
      Returns:
        the detected dialect

    - #### getDialect

          public static StAXDialect getDialect(javax.xml.stream.XMLOutputFactory factory)

      Detect the StAX dialect of a given `XMLOutputFactory` instance.
      Parameters:
        `factory` - the factory instance
      Returns:
        the detected dialect

Copyright © The Apache Software Foundation. All Rights Reserved.