public class DocumentContainer extends XMLParser2 implements Container
Modifier and Type | Field and Description |
---|---|
static String |
MODEL_DOM
DOM constant
|
static String |
MODEL_JDOM
JDOM constant
|
Constructor and Description |
---|
DocumentContainer(URL xmlURL)
Use this constructor if the desired model is DOM.
|
DocumentContainer(URL xmlURL,
String model)
Construct a new DocumentContainer.
|
Modifier and Type | Method and Description |
---|---|
Object |
getValue()
Reads XML, caches it internally and returns the Document.
|
Object |
parseXML(InputStream stream)
Parses XML using the parser for the specified model.
|
static void |
registerXMLParser(String model,
String parserClassName)
Add a class of a custom XML parser.
|
static void |
registerXMLParser(String model,
XMLParser parser)
Add an XML parser.
|
void |
setValue(Object value)
Throws an UnsupportedOperationException.
|
isCoalescing, isExpandEntityReferences, isIgnoringComments, isIgnoringElementContentWhitespace, isNamespaceAware, isValidating, setCoalescing, setExpandEntityReferences, setIgnoringComments, setIgnoringElementContentWhitespace, setNamespaceAware, setValidating
public static final String MODEL_DOM
public static final String MODEL_JDOM
public DocumentContainer(URL xmlURL)
xmlURL
- is a URL for an XML file.
Use getClass().getResource(resourceName) to load XML from a
resource file.public DocumentContainer(URL xmlURL, String model)
xmlURL
- is a URL for an XML file. Use getClass().getResource
(resourceName) to load XML from a resource file.model
- is one of the MODEL_* constants defined in this class. It
determines which parser should be used to load the XML.public static void registerXMLParser(String model, XMLParser parser)
model
- model nameparser
- parserpublic static void registerXMLParser(String model, String parserClassName)
model
- model nameparserClassName
- parser classnamepublic Object parseXML(InputStream stream)
parseXML
in interface XMLParser
parseXML
in class XMLParser2
stream
- InputStreamCopyright © 2001–2015 The Apache Software Foundation. All rights reserved.