org.apache.commons.jxpath.xml
Class DocumentContainer
- Container, XMLParser
public class 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.
$Revision: 1.9 $ $Date: 2004/02/29 14:17:37 $
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 , parseXML , setCoalescing , setExpandEntityReferences , setIgnoringComments , setIgnoringElementContentWhitespace , setNamespaceAware , setValidating |
MODEL_DOM
public static final String MODEL_DOM
MODEL_JDOM
public static final String MODEL_JDOM
DocumentContainer
public DocumentContainer(URL xmlURL)
Use this constructor if the desired model is DOM.
DocumentContainer
public DocumentContainer(URL xmlURL,
String model)
model
- is one of the MODEL_* constants defined in this class. It
determines which parser should be used to load the XML.
getValue
public Object getValue()
Reads XML, caches it internally and returns the Document.
- getValue in interface Container
registerXMLParser
public static void registerXMLParser(String model,
String parserClassName)
Add a class of a custom XML parser.
Parsers for the models "DOM" and "JDOM" are pre-registered.
registerXMLParser
public static void registerXMLParser(String model,
XMLParser parser)
Add an XML parser. Parsers for the models "DOM" and "JDOM" are
pre-registered.
setValue
public void setValue(Object value)
Throws an UnsupportedOperationException
- setValue in interface Container