|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.isr.yancees.util.DOMNodeAdapter
public class DOMNodeAdapter
This class wraps a DOM node and returns the text we want to display in the tree. It also returns children, index values, and child counts. This class is used by the Managers, by the Event class and others to perform common operations around the DOM tree.
Field Summary | |
---|---|
static java.lang.String |
CONTEXT_SEPARATOR
|
static java.lang.String |
TYPE_ATTRIBUTE
|
Constructor Summary | |
---|---|
DOMNodeAdapter(org.w3c.dom.Node node)
|
|
DOMNodeAdapter(org.w3c.dom.Node node,
java.lang.String[] validNames)
|
|
DOMNodeAdapter(org.w3c.dom.Node node,
java.lang.String[] validNames,
boolean doFilter)
|
Method Summary | |
---|---|
DOMNodeAdapter |
child(int searchIndex)
Gets the child indexed. |
int |
childCount()
Count the number of children of the current node. |
org.w3c.dom.Node[] |
getElementsByName(java.lang.String tagName)
Searches the current DOM tree recursively looking for elements with the provided name. |
org.w3c.dom.Node |
getFirstElementByName(java.lang.String tagName)
Searches the current DOM tree recursively looking for the first element with the provided name. |
static java.lang.String |
getFullContext(org.w3c.dom.Node father)
This method is declared static for performance reasons, preventing the creation of a DOMNodeAdapter for each node that one would like to parse. |
java.lang.String |
getFullPath()
|
static java.lang.String |
getFullPath(org.w3c.dom.Node father)
This method is declared static for performance reasons, preventing the creation of a DOMNodeAdapter for each node that one would like to parse. |
java.lang.String |
getHTMLContent()
Prints the HTML content of the current Node. |
java.lang.String |
getNodeText()
|
org.w3c.dom.Node[] |
getVisibleElementsBFS()
|
org.w3c.dom.Node[] |
getVisibleElementsDFS()
|
boolean |
hasChildElement(java.lang.String elementName)
|
int |
index(DOMNodeAdapter child)
|
boolean |
isFilteringNodes()
|
boolean |
isTreeElement(java.lang.String elementName)
Used to filter the XML Schema elements to consider while parsing this DOM tree. |
void |
printNodeTree()
Recursively parsers the dom model, using the facilities of the DOMNodeAdapter class, and prints it to the standard output. |
void |
printNodeTree(org.w3c.dom.Node n)
Recursively parsers the dom model, using the facilities of the DOMNodeAdapter class, and prints it to the standard output. |
void |
setFilterNodes(boolean mode)
Sets the display of visible tree nodes to be active or inactive. |
void |
setVisibleTreeElementNames(java.lang.String[] names)
Allows the specification of a list of elements to filter in all operations. |
java.lang.String |
toString()
Return a string that identifies this node in the tree |
java.lang.String |
toXML()
|
java.lang.String |
toXMLIndented()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TYPE_ATTRIBUTE
public static final java.lang.String CONTEXT_SEPARATOR
Constructor Detail |
---|
public DOMNodeAdapter(org.w3c.dom.Node node)
public DOMNodeAdapter(org.w3c.dom.Node node, java.lang.String[] validNames)
node
- is the head of the subtreevalidNames
- is the visibleTreeElementNamespublic DOMNodeAdapter(org.w3c.dom.Node node, java.lang.String[] validNames, boolean doFilter)
node
- is the head of the subtreevalidNames
- is the visibleTreeElementNamesMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getHTMLContent()
public org.w3c.dom.Node[] getVisibleElementsDFS()
public org.w3c.dom.Node[] getVisibleElementsBFS()
public java.lang.String getFullPath()
public int index(DOMNodeAdapter child)
child
- a node to be searched among the immediate chindren of this
node.
public DOMNodeAdapter child(int searchIndex)
searchIndex
- is the index of the children of current node to be returned
as a DOMNodeAdapterpublic int childCount()
public boolean hasChildElement(java.lang.String elementName)
elementName
- is the name of the ELEMENT_TYPE node to search
public java.lang.String getNodeText()
public org.w3c.dom.Node[] getElementsByName(java.lang.String tagName)
public org.w3c.dom.Node getFirstElementByName(java.lang.String tagName)
public boolean isTreeElement(java.lang.String elementName)
public void setVisibleTreeElementNames(java.lang.String[] names)
public void setFilterNodes(boolean mode)
public boolean isFilteringNodes()
public void printNodeTree()
public void printNodeTree(org.w3c.dom.Node n)
public java.lang.String toXML()
public java.lang.String toXMLIndented()
public static java.lang.String getFullPath(org.w3c.dom.Node father)
public static java.lang.String getFullContext(org.w3c.dom.Node father)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |