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

Quick Search    Search Deep

com.aendvari.common.model
Interface ModelNode  view ModelNode download ModelNode.java


public interface ModelNode

The ModelNode interface represents a specific node in the XML or OSM implementation. Typically the implementation would include a reference to the OsmNode or Node (XML) object.


Method Summary
 ModelNode appendChild(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 attribute.
 java.util.Map getAttributes()
          Returns the attributes of this node.
 java.util.List getChildNodes()
          Returns a List of ModelNode's using the path provided.
 ModelNode getFirstChild()
          The first child of this node.
 ModelNode getLastChild()
          The last child of this node.
 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.
 ModelTree getOwnerModelTree()
          Returns the instance of ModelTree from which the ModelNode is within.
 ModelNode getParentNode()
          The parent of this node.
 ModelNode getPreviousSibling()
          The node immediately preceding this node.
 boolean hasChildNodes()
          Returns whether this node has any children.
 ModelNode insertBefore(ModelNode newChild, ModelNode refChild)
          Inserts the node newChild before the existing child node refChild.
 ModelNode removeChild(ModelNode oldChild)
          Removes the child node indicated by oldChild from the list of children, and returns it.
 ModelNode replaceChild(ModelNode newChild, 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.
 

Method Detail

getOwnerModelTree

public ModelTree getOwnerModelTree()
Returns the instance of ModelTree from which the ModelNode is within.


getNodeValue

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


setNodeValue

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


getNodeName

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


getNodePath

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


getAttributes

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


getAttribute

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


setAttribute

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


getParentNode

public ModelNode getParentNode()
The parent of this node. All nodes, except the root (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.


getFirstChild

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


getLastChild

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


getPreviousSibling

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


getNextSibling

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


getChildNodes

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


hasChildNodes

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


appendChild

public ModelNode appendChild(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.


insertBefore

public ModelNode insertBefore(ModelNode newChild,
                              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.


replaceChild

public ModelNode replaceChild(ModelNode newChild,
                              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.


removeChild

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