|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.util.xml.XMLEventParserContextFactory
public class XMLEventParserContextFactory
Provides a global registry of XML parsers. Enables registration of parsers for specific mime types and namespace specialization. Parsers should generally be drawn from this class in order to ensure that parsers configured by World Wind and the application are used.
| Nested Class Summary | |
|---|---|
protected static class |
XMLEventParserContextFactory.ParserTableEntry
Holds the mime types and the associated prototype parser. |
| Field Summary | |
|---|---|
protected static List<XMLEventParserContextFactory.ParserTableEntry> |
parsers
The list of registered parser contexts. |
| Constructor Summary | |
|---|---|
XMLEventParserContextFactory()
|
|
| Method Summary | |
|---|---|
static void |
addParserContext(String[] mimeTypes,
XMLEventParserContext prototypeContext)
Appends a specified prototype parser context to the list of those already registered. |
protected static XMLEventParserContext |
createInstanceFromPrototype(XMLEventParserContext prototype)
Constructs a new parser context given a prototype parser context. |
static XMLEventParserContext |
createParserContext(String mimeType,
String defaultNamespace)
Constructs and returns a parser context for a specified mime type and namespace. |
static void |
prependParserContext(String[] mimeTypes,
XMLEventParserContext prototypeContext)
Prepends a specified prototype parser context to the list of those already registered. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static List<XMLEventParserContextFactory.ParserTableEntry> parsers
| Constructor Detail |
|---|
public XMLEventParserContextFactory()
| Method Detail |
|---|
public static void addParserContext(String[] mimeTypes,
XMLEventParserContext prototypeContext)
mimeTypes - the list of mime types for which to use the specified prototype parser context.prototypeContext - the prototype parser context to use for the specified mime types. This parser context's
class must provide a copy constructor, a constructor that takes an instance of its class
as its only argument.
IllegalArgumentException - if the mime type list is null or empty or the prototype context is null or has
no copy constructor.
protected static XMLEventParserContext createInstanceFromPrototype(XMLEventParserContext prototype)
throws Exception
prototype - the prototype parser context. This parser context's class must provide a copy constructor, a
constructor that takes an instance of the class as its only argument.
Exception - if an exception occurs while attempting to construct the new context.
public static XMLEventParserContext createParserContext(String mimeType,
String defaultNamespace)
XMLConstants.NULL_NS_URI does not match any other namespace. In order for
a parser context with the empty namespace to be returned, one with the empty namespace must be registered.
mimeType - the mime type for which to construct a parser.defaultNamespace - a namespace qualifying the parser context to return. May be null, in which case a parser
context for the specified mime type and an empty namespace, XMLConstants.NULL_NS_URI, is searched for.
IllegalArgumentException - if the specified mime type is null.
public static void prependParserContext(String[] mimeTypes,
XMLEventParserContext prototypeContext)
mimeTypes - the list of mime types for which to use the specified prototype parser context.prototypeContext - the prototype parser context to use for the specified mime types. This parser context's
class must provide a copy constructor, a constructor that takes an instance of its class
as its only argument.
IllegalArgumentException - if the mime type list is null or empty or the prototype context is null or has
no copy constructor.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||