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

Quick Search    Search Deep

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

java.lang.Object
  extended bycom.aendvari.common.model.xalan.XalanModelNode
All Implemented Interfaces:
com.aendvari.common.model.ModelNode

public class XalanModelNode
extends java.lang.Object
implements com.aendvari.common.model.ModelNode

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


Field Summary
protected  org.w3c.dom.Node modelNode
          The DOM node
protected  java.lang.String modelValue
          The node value.
protected  XalanModelTree owner
          The owning model tree.
 
Constructor Summary
protected XalanModelNode(XalanModelTree setOwner)
          Constructs a XalanModelNode instance.
protected XalanModelNode(XalanModelTree setOwner, org.w3c.dom.Node setModelNode)
          Constructs a XalanModelNode instance wrapping the supplied org.w3c.dom.Node.
protected XalanModelNode(XalanModelTree setOwner, java.lang.String setModelValue)
          This is used in XalanModelTree::getNode()
 
Method Summary
 com.aendvari.common.model.ModelNode appendChild(com.aendvari.common.model.ModelNode newChild)
          Adds the node newChild to the end of the list of children of this node.
 java.lang.String getAttribute(java.lang.String name)
          Returns the string value of the specified attribute.
 java.util.Map getAttributes()
          Returns the attributes of this node.
 java.util.List getChildNodes()
          Returns a List of com.aendvari.common.model.ModelNode's using the path provided.
 com.aendvari.common.model.ModelNode getFirstChild()
          The first child of this node.
 com.aendvari.common.model.ModelNode getLastChild()
          The last child of this node.
 com.aendvari.common.model.ModelNode getNextSibling()
          The node immediately following this node.
 java.lang.String getNodeName()
          Returns the name of this node.
 java.lang.String getNodePath()
          Returns a string representation of the node's position in the hierarchy.
 java.lang.String getNodeValue()
          Returns the value of the node.
 com.aendvari.common.model.ModelTree getOwnerModelTree()
          Returns the instance of ModelTree from which the com.aendvari.common.model.ModelNode is within.
 com.aendvari.common.model.ModelNode getParentNode()
          The parent of this node.
 com.aendvari.common.model.ModelNode getPreviousSibling()
          The node immediately preceding this node.
protected  java.lang.String getTextValue()
          Returns the text within the node.
 org.w3c.dom.Node getXmlNode()
          Returns the internal XML org.w3c.dom.Node object wrapped by this com.aendvari.common.model.ModelNode.
 boolean hasChildNodes()
          Returns whether this node has any children.
 com.aendvari.common.model.ModelNode insertBefore(com.aendvari.common.model.ModelNode newChild, com.aendvari.common.model.ModelNode refChild)
          Inserts the node newChild before the existing child node refChild.
 com.aendvari.common.model.ModelNode removeChild(com.aendvari.common.model.ModelNode oldChild)
          Removes the child node indicated by oldChild from the list of children, and returns it.
 com.aendvari.common.model.ModelNode replaceChild(com.aendvari.common.model.ModelNode newChild, com.aendvari.common.model.ModelNode oldChild)
          Replaces the child node oldChild with newChild, and returns the oldChild node.
 void setAttribute(java.lang.String name, java.lang.String value)
          Sets the string value of the attribute.
 void setNodeValue(java.lang.String value)
          Sets the value of the node.
 void setXmlNode(org.w3c.dom.Node setModelNode)
          Sets the internal XML org.w3c.dom.Node object wrapped by this com.aendvari.common.model.ModelNode.
protected  void setXmlValue()
          Caches the value of the XML org.w3c.dom.Node, if any.
 java.lang.String toString()
          Display the string value of the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

owner

protected XalanModelTree owner
The owning model tree.


modelNode

protected org.w3c.dom.Node modelNode
The DOM node


modelValue

protected java.lang.String modelValue
The node value.

Constructor Detail

XalanModelNode

protected XalanModelNode(XalanModelTree setOwner)
Constructs a XalanModelNode instance.


XalanModelNode

protected XalanModelNode(XalanModelTree setOwner,
                         org.w3c.dom.Node setModelNode)
Constructs a XalanModelNode instance wrapping the supplied org.w3c.dom.Node.


XalanModelNode

protected XalanModelNode(XalanModelTree setOwner,
                         java.lang.String setModelValue)
This is used in XalanModelTree::getNode()

Method Detail

setXmlNode

public void setXmlNode(org.w3c.dom.Node setModelNode)
Sets the internal XML org.w3c.dom.Node object wrapped by this com.aendvari.common.model.ModelNode.


getXmlNode

public org.w3c.dom.Node getXmlNode()
Returns the internal XML org.w3c.dom.Node object wrapped by this com.aendvari.common.model.ModelNode.


setXmlValue

protected void setXmlValue()
Caches the value of the XML org.w3c.dom.Node, if any.


getOwnerModelTree

public com.aendvari.common.model.ModelTree getOwnerModelTree()
Returns the instance of ModelTree from which the com.aendvari.common.model.ModelNode is within.

Specified by:
getOwnerModelTree in interface com.aendvari.common.model.ModelNode

getNodeValue

public java.lang.String getNodeValue()
Returns the value of the node.

Specified by:
getNodeValue in interface com.aendvari.common.model.ModelNode

getTextValue

protected java.lang.String getTextValue()
Returns the text within the node.


setNodeValue

public void setNodeValue(java.lang.String value)
Sets the value of the node.

Specified by:
setNodeValue in interface com.aendvari.common.model.ModelNode

getNodeName

public java.lang.String getNodeName()
Returns the name of this node.

Specified by:
getNodeName in interface com.aendvari.common.model.ModelNode

getNodePath

public java.lang.String getNodePath()
Returns a string representation of the node's position in the hierarchy.

Specified by:
getNodePath in interface com.aendvari.common.model.ModelNode

getAttributes

public java.util.Map getAttributes()
Returns the attributes of this node.

Specified by:
getAttributes in interface com.aendvari.common.model.ModelNode

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Returns the string value of the specified attribute.

Specified by:
getAttribute in interface com.aendvari.common.model.ModelNode

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Sets the string value of the attribute.

Specified by:
setAttribute in interface com.aendvari.common.model.ModelNode

getParentNode

public com.aendvari.common.model.ModelNode getParentNode()
The parent of this node. All nodes, except the root (com.aendvari.common.model.ModelNode) node may have a parent. If a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null.

Specified by:
getParentNode in interface com.aendvari.common.model.ModelNode

getFirstChild

public com.aendvari.common.model.ModelNode getFirstChild()
The first child of this node. If there is no such node, this returns null.

Specified by:
getFirstChild in interface com.aendvari.common.model.ModelNode

getLastChild

public com.aendvari.common.model.ModelNode getLastChild()
The last child of this node. If there is no such node, this returns null.

Specified by:
getLastChild in interface com.aendvari.common.model.ModelNode

getPreviousSibling

public com.aendvari.common.model.ModelNode getPreviousSibling()
The node immediately preceding this node. If there is no such node, this returns null.

Specified by:
getPreviousSibling in interface com.aendvari.common.model.ModelNode

getNextSibling

public com.aendvari.common.model.ModelNode getNextSibling()
The node immediately following this node. If there is no such node, this returns null.

Specified by:
getNextSibling in interface com.aendvari.common.model.ModelNode

getChildNodes

public java.util.List getChildNodes()
Returns a List of com.aendvari.common.model.ModelNode's using the path provided.

Specified by:
getChildNodes in interface com.aendvari.common.model.ModelNode

hasChildNodes

public boolean hasChildNodes()
Returns whether this node has any children.

Specified by:
hasChildNodes in interface com.aendvari.common.model.ModelNode

appendChild

public com.aendvari.common.model.ModelNode appendChild(com.aendvari.common.model.ModelNode newChild)
Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.

Specified by:
appendChild in interface com.aendvari.common.model.ModelNode

insertBefore

public com.aendvari.common.model.ModelNode insertBefore(com.aendvari.common.model.ModelNode newChild,
                                                        com.aendvari.common.model.ModelNode refChild)
Inserts the node newChild before the existing child node refChild. If refChild is null, newChild is inserted at the end of the list of children. If the newChild is already in the tree, it is first removed.

Specified by:
insertBefore in interface com.aendvari.common.model.ModelNode

replaceChild

public com.aendvari.common.model.ModelNode replaceChild(com.aendvari.common.model.ModelNode newChild,
                                                        com.aendvari.common.model.ModelNode oldChild)
Replaces the child node oldChild with newChild, and returns the oldChild node. If the newChild is already in the tree, it is first removed.

Specified by:
replaceChild in interface com.aendvari.common.model.ModelNode

removeChild

public com.aendvari.common.model.ModelNode removeChild(com.aendvari.common.model.ModelNode oldChild)
Removes the child node indicated by oldChild from the list of children, and returns it.

Specified by:
removeChild in interface com.aendvari.common.model.ModelNode

toString

public java.lang.String toString()
Display the string value of the node.