public class StAXDialectDetector
extends java.lang.Object
Note that this class internally maintains a cache of detected dialects. The overhead caused by invocations of methods in this class is thus small.
| Modifier and Type | Field and Description |
|---|---|
private static java.util.jar.Attributes.Name |
BUNDLE_SYMBOLIC_NAME |
private static java.util.jar.Attributes.Name |
BUNDLE_VENDOR |
private static java.util.jar.Attributes.Name |
BUNDLE_VERSION |
private static java.util.Map |
dialectByUrl
Map that stores detected dialects by location.
|
private static java.util.jar.Attributes.Name |
IMPLEMENTATION_TITLE |
private static java.util.jar.Attributes.Name |
IMPLEMENTATION_VENDOR |
private static java.util.jar.Attributes.Name |
IMPLEMENTATION_VERSION |
private static org.apache.commons.logging.Log |
log |
| Modifier | Constructor and Description |
|---|---|
private |
StAXDialectDetector() |
| Modifier and Type | Method and Description |
|---|---|
private static StAXDialect |
detectDialect(java.lang.ClassLoader classLoader,
java.net.URL rootUrl) |
private static StAXDialect |
detectDialectFromClasses(java.lang.ClassLoader classLoader,
java.net.URL rootUrl) |
private static StAXDialect |
detectDialectFromJarManifest(java.net.URL rootUrl) |
static StAXDialect |
getDialect(java.lang.Class implementationClass)
Detect the dialect of a given StAX implementation.
|
private static StAXDialect |
getDialect(java.lang.ClassLoader classLoader,
java.net.URL rootUrl) |
private static java.net.URL |
getRootUrlForClass(java.lang.Class cls) |
private static java.net.URL |
getRootUrlForResource(java.lang.ClassLoader classLoader,
java.lang.String resource)
Get the URL corresponding to the root folder of the classpath entry from which a given
resource is loaded.
|
private static java.lang.Class |
loadClass(java.lang.ClassLoader classLoader,
java.net.URL rootUrl,
java.lang.String name) |
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. |
private static final org.apache.commons.logging.Log log
private static final java.util.jar.Attributes.Name IMPLEMENTATION_TITLE
private static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR
private static final java.util.jar.Attributes.Name IMPLEMENTATION_VERSION
private static final java.util.jar.Attributes.Name BUNDLE_SYMBOLIC_NAME
private static final java.util.jar.Attributes.Name BUNDLE_VENDOR
private static final java.util.jar.Attributes.Name BUNDLE_VERSION
private static final java.util.Map dialectByUrl
private static java.net.URL getRootUrlForResource(java.lang.ClassLoader classLoader,
java.lang.String resource)
null if the resource can't be found or if it is not
possible to determine the root URLprivate static java.net.URL getRootUrlForClass(java.lang.Class cls)
public static javax.xml.stream.XMLInputFactory normalize(javax.xml.stream.XMLInputFactory factory)
XMLInputFactory and normalize it.factory - the factory to normalizeStAXDialect.normalize(XMLInputFactory)public static javax.xml.stream.XMLOutputFactory normalize(javax.xml.stream.XMLOutputFactory factory)
XMLOutputFactory and normalize it.factory - the factory to normalizeStAXDialect.normalize(XMLOutputFactory)public static StAXDialect getDialect(java.lang.Class implementationClass)
implementationClass - any class that is part of the StAX implementation; typically this should be a
XMLInputFactory, XMLOutputFactory,
XMLStreamReader or
XMLStreamWriter implementationprivate static StAXDialect getDialect(java.lang.ClassLoader classLoader, java.net.URL rootUrl)
private static StAXDialect detectDialect(java.lang.ClassLoader classLoader, java.net.URL rootUrl)
private static StAXDialect detectDialectFromJarManifest(java.net.URL rootUrl)
private static java.lang.Class loadClass(java.lang.ClassLoader classLoader,
java.net.URL rootUrl,
java.lang.String name)
private static StAXDialect detectDialectFromClasses(java.lang.ClassLoader classLoader, java.net.URL rootUrl)