Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.aendvari.common.model.xalan
Class XalanModelTree  view XalanModelTree download XalanModelTree.java

java.lang.Object
  extended bycom.aendvari.common.model.xalan.XalanModelTree
All Implemented Interfaces:
com.aendvari.common.model.ModelTree

public class XalanModelTree
extends java.lang.Object
implements com.aendvari.common.model.ModelTree

A Xalan XML implementation of the com.aendvari.common.model.ModelNode interface.


Field Summary
protected  org.w3c.dom.Document modelTreeDocument
          The document that represents the model tree
protected  boolean modified
          Tracks whether the XML DOM has been modified.
protected  org.apache.xpath.XPath xpath
          XPath query.
protected  org.apache.xpath.XPathContext xpathContext
          Runtime context for XPath queries.
protected  org.apache.xpath.compiler.XPathParser xpathParser
          XPath expression parser.
 
Constructor Summary
XalanModelTree()
          Constructs a XalanModelTree instance.
XalanModelTree(org.w3c.dom.Document setModelTree)
          Constructs a XalanModelNode instance wrapping the supplied org.w3c.dom.Document.
 
Method Summary
 com.aendvari.common.model.ModelNode createNode(java.lang.String name)
          Creates a com.aendvari.common.model.ModelNode object.
 com.aendvari.common.model.ModelNode createNode(java.lang.String name, java.lang.String value)
          Creates a com.aendvari.common.model.ModelNode object with the supplied value.
 com.aendvari.common.model.ModelTree createTree()
          Creates a new com.aendvari.common.model.ModelTree object.
protected  void createXPathObjects()
          Creates objects for performing XPath queries.
 org.w3c.dom.Document getModelTree()
          Returns the internal XML org.w3c.dom.Document object wrapped by this com.aendvari.common.model.ModelTree.
 com.aendvari.common.model.ModelNode getNode(com.aendvari.common.model.ModelNode node, java.lang.String path)
          Returns the com.aendvari.common.model.ModelNode using the path provided.
 java.util.List getNodes(com.aendvari.common.model.ModelNode node, java.lang.String path)
          Returns a List of com.aendvari.common.model.ModelNode's using the path provided.
 com.aendvari.common.model.ModelNode getRootNode()
          Returns the com.aendvari.common.model.ModelNode of the DOM model space.
 void loadFromFile(java.lang.String xmlFile)
          Replaces the current com.aendvari.common.model.ModelTree with the given XML.
 void loadFromStream(java.io.InputStream xmlStream)
          Replaces the current com.aendvari.common.model.ModelTree with the given XML stream.
 void setModelTree(org.w3c.dom.Document setModelTree)
          Sets the internal XML org.w3c.dom.Document object wrapped by this com.aendvari.common.model.ModelTree.
 void setModified()
          States that the XML DOM has been modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelTreeDocument

protected org.w3c.dom.Document modelTreeDocument
The document that represents the model tree


modified

protected boolean modified
Tracks whether the XML DOM has been modified.


xpathContext

protected org.apache.xpath.XPathContext xpathContext
Runtime context for XPath queries.


xpathParser

protected org.apache.xpath.compiler.XPathParser xpathParser
XPath expression parser.


xpath

protected org.apache.xpath.XPath xpath
XPath query.

Constructor Detail

XalanModelTree

public XalanModelTree()
               throws com.aendvari.common.model.ModelException
Constructs a XalanModelTree instance.


XalanModelTree

public XalanModelTree(org.w3c.dom.Document setModelTree)
Constructs a XalanModelNode instance wrapping the supplied org.w3c.dom.Document.

Method Detail

setModified

public void setModified()
States that the XML DOM has been modified.


createXPathObjects

protected void createXPathObjects()
                           throws com.aendvari.common.model.ModelException
Creates objects for performing XPath queries.


setModelTree

public void setModelTree(org.w3c.dom.Document setModelTree)
Sets the internal XML org.w3c.dom.Document object wrapped by this com.aendvari.common.model.ModelTree.


getModelTree

public org.w3c.dom.Document getModelTree()
Returns the internal XML org.w3c.dom.Document object wrapped by this com.aendvari.common.model.ModelTree.


getRootNode

public com.aendvari.common.model.ModelNode getRootNode()
Returns the com.aendvari.common.model.ModelNode of the DOM model space.

Specified by:
getRootNode in interface com.aendvari.common.model.ModelTree

createNode

public com.aendvari.common.model.ModelNode createNode(java.lang.String name)
Creates a com.aendvari.common.model.ModelNode object.

Specified by:
createNode in interface com.aendvari.common.model.ModelTree

createTree

public com.aendvari.common.model.ModelTree createTree()
Creates a new com.aendvari.common.model.ModelTree object.

Specified by:
createTree in interface com.aendvari.common.model.ModelTree

createNode

public com.aendvari.common.model.ModelNode createNode(java.lang.String name,
                                                      java.lang.String value)
Creates a com.aendvari.common.model.ModelNode object with the supplied value.

Specified by:
createNode in interface com.aendvari.common.model.ModelTree

getNode

public com.aendvari.common.model.ModelNode getNode(com.aendvari.common.model.ModelNode node,
                                                   java.lang.String path)
                                            throws com.aendvari.common.model.ModelException
Returns the com.aendvari.common.model.ModelNode using the path provided.

Specified by:
getNode in interface com.aendvari.common.model.ModelTree

getNodes

public java.util.List getNodes(com.aendvari.common.model.ModelNode node,
                               java.lang.String path)
                        throws com.aendvari.common.model.ModelException
Returns a List of com.aendvari.common.model.ModelNode's using the path provided.

Specified by:
getNodes in interface com.aendvari.common.model.ModelTree

loadFromFile

public void loadFromFile(java.lang.String xmlFile)
                  throws com.aendvari.common.model.ModelParserException
Replaces the current com.aendvari.common.model.ModelTree with the given XML.

Specified by:
loadFromFile in interface com.aendvari.common.model.ModelTree

loadFromStream

public void loadFromStream(java.io.InputStream xmlStream)
                    throws com.aendvari.common.model.ModelParserException
Replaces the current com.aendvari.common.model.ModelTree with the given XML stream.

Specified by:
loadFromStream in interface com.aendvari.common.model.ModelTree