|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.jxpath.xml.XMLParser2 org.apache.commons.jxpath.xml.DocumentContainer
An XML document container reads and parses XML only when it is accessed. JXPath traverses Containers transparently - you use the same paths to access objects in containers as you do to access those objects directly. You can create XMLDocumentContainers for various XML documents that may or may not be accessed by XPaths. If they are, they will be automatically read, parsed and traversed. If they are not - they won't be read at all.
Field Summary | |
private java.lang.Object |
document
|
private java.lang.String |
model
|
static java.lang.String |
MODEL_DOM
|
static java.lang.String |
MODEL_JDOM
|
private static java.util.HashMap |
parserClasses
|
private static java.util.HashMap |
parsers
|
private java.net.URL |
xmlURL
|
Fields inherited from class org.apache.commons.jxpath.xml.XMLParser2 |
|
Constructor Summary | |
DocumentContainer(java.net.URL xmlURL)
Use this constructor if the desired model is DOM. |
|
DocumentContainer(java.net.URL xmlURL,
java.lang.String model)
|
Method Summary | |
private static XMLParser |
getParser(java.lang.String model)
Maps a model type to a parser. |
java.lang.Object |
getValue()
Reads XML, caches it internally and returns the Document. |
java.lang.Object |
parseXML(java.io.InputStream stream)
Parses XML using the parser for the specified model. |
static void |
registerXMLParser(java.lang.String model,
java.lang.String parserClassName)
Add a class of a custom XML parser. |
static void |
registerXMLParser(java.lang.String model,
XMLParser parser)
Add an XML parser. |
void |
setValue(java.lang.Object value)
Throws an UnsupportedOperationException |
Methods inherited from class org.apache.commons.jxpath.xml.XMLParser2 |
isCoalescing, isExpandEntityReferences, isIgnoringComments, isIgnoringElementContentWhitespace, isNamespaceAware, isValidating, setCoalescing, setExpandEntityReferences, setIgnoringComments, setIgnoringElementContentWhitespace, setNamespaceAware, setValidating |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String MODEL_DOM
public static final java.lang.String MODEL_JDOM
private java.lang.Object document
private java.net.URL xmlURL
private java.lang.String model
private static java.util.HashMap parserClasses
private static java.util.HashMap parsers
Constructor Detail |
public DocumentContainer(java.net.URL xmlURL)
public DocumentContainer(java.net.URL xmlURL, java.lang.String model)
model
- is one of the MODEL_* constants defined in this class. It
determines which parser should be used to load the XML.Method Detail |
public static void registerXMLParser(java.lang.String model, XMLParser parser)
public static void registerXMLParser(java.lang.String model, java.lang.String parserClassName)
public java.lang.Object getValue()
getValue
in interface Container
public java.lang.Object parseXML(java.io.InputStream stream)
parseXML
in interface XMLParser
parseXML
in class XMLParser2
public void setValue(java.lang.Object value)
setValue
in interface Container
private static final XMLParser getParser(java.lang.String model)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |