Package nu.validator.saxtree
Class ParentNode
- java.lang.Object
-
- nu.validator.saxtree.Node
-
- nu.validator.saxtree.ParentNode
-
-
Field Summary
Fields Modifier and Type Field Description protected org.xml.sax.LocatorendLocatorThe end locator.private NodefirstChildThe first child.private NodelastChildThe last child (for efficiency).
-
Constructor Summary
Constructors Constructor Description ParentNode(org.xml.sax.Locator locator)The constuctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeappendChild(Node child)Append a child to this node and return the child.voidappendChildren(Node parent)Append the children of another node to this node removing them from the other node .voidcopyEndLocator(ParentNode another)Copies the endLocator from another node.NodegetFirstChild()Returns the firstChild.NodegetLastChild()Returns the lastChild.NodeinsertBefore(Node child, Node sibling)Insert a new child before a pre-existing child and return the newly inserted child.NodeinsertBetween(Node child, Node prev, Node next)(package private) voidremoveChild(Node node)Remove a child from this node.voidsetEndLocator(org.xml.sax.Locator endLocator)Sets the endLocator.-
Methods inherited from class nu.validator.saxtree.Node
detach, getAttributes, getColumnNumber, getData, getLineNumber, getLocalName, getName, getNextSibling, getNodeType, getParentNode, getPrefixMappings, getPreviousSibling, getPublicId, getPublicIdentifier, getQName, getSystemId, getSystemIdentifier, getTarget, getUri, revisit, setNextSibling, setParentNode, visit
-
-
-
-
Method Detail
-
setEndLocator
public void setEndLocator(org.xml.sax.Locator endLocator)
Sets the endLocator.- Parameters:
endLocator- the endLocator to set
-
copyEndLocator
public void copyEndLocator(ParentNode another)
Copies the endLocator from another node.- Parameters:
another- the another node
-
getFirstChild
public final Node getFirstChild()
Returns the firstChild.- Overrides:
getFirstChildin classNode- Returns:
- the firstChild
-
getLastChild
public final Node getLastChild()
Returns the lastChild.- Returns:
- the lastChild
-
insertBefore
public Node insertBefore(Node child, Node sibling)
Insert a new child before a pre-existing child and return the newly inserted child.- Parameters:
child- the new childsibling- the existing child before which to insert (must be a child of this node) ornullto append- Returns:
child
-
appendChild
public Node appendChild(Node child)
Append a child to this node and return the child.- Parameters:
child- the child to append.- Returns:
child
-
appendChildren
public void appendChildren(Node parent)
Append the children of another node to this node removing them from the other node .- Parameters:
parent- the other node whose children to append to this one
-
removeChild
void removeChild(Node node)
Remove a child from this node.- Parameters:
node- the child to remove
-
-