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

Quick Search    Search Deep

gov.lanl.Utility.xml
Class DomUtils  view DomUtils download DomUtils.java

java.lang.Object
  extended bygov.lanl.Utility.xml.DomUtils
All Implemented Interfaces:
java.io.Serializable

public class DomUtils
extends java.lang.Object
implements java.io.Serializable


Field Summary
private  org.w3c.dom.Document domTree
           
 
Constructor Summary
DomUtils()
          Creates new DomUtils
 
Method Summary
 org.w3c.dom.Element[] getAllChildrenWithAttribute(org.w3c.dom.Element root, java.lang.String elementname, java.lang.String attribname, java.lang.String attribval)
          returns all nodes of root with elementname having matching attribute and value
 org.w3c.dom.Element[] getAllChildrenWithAttributeName(org.w3c.dom.Element root, java.lang.String elementname, java.lang.String attribname)
          returns all nodes of root with elementname having matching attributename
 org.w3c.dom.Element[] getAllElementsWithAttribute(java.lang.String elementname, java.lang.String attribname, java.lang.String attribval)
          returns all nodes with elementname having matching attribute and value
 org.w3c.dom.Element[] getAllElementsWithAttributeName(java.lang.String elementname, java.lang.String attribname)
          returns all nodes with elementname having matching attributenam
static org.w3c.dom.Element getChildName(org.w3c.dom.Element parentNode, java.lang.String childname)
          return the first element of child of parent node
static org.w3c.dom.Element[] getChildrenNamed(org.w3c.dom.Element parentNode, java.lang.String childName)
          Get a list of Elements that are children of the parent and with the given name
static org.w3c.dom.Element getChildWithAttribute(org.w3c.dom.Element parentNode, java.lang.String childname, java.lang.String attribname, java.lang.String attribval)
          get the element that is a child of parentNode
 org.w3c.dom.Element getElementWithAttribute(java.lang.String elementname, java.lang.String attribname, java.lang.String attribval)
          returns first element on preorder traversal with matching attribname and value
 org.w3c.dom.Element getRootElement()
           
 void setdomTree(org.w3c.dom.Document domtree)
           
 java.lang.String toString()
          Serialize Content to String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

domTree

private org.w3c.dom.Document domTree
Constructor Detail

DomUtils

public DomUtils()
Creates new DomUtils

Method Detail

setdomTree

public void setdomTree(org.w3c.dom.Document domtree)

getRootElement

public org.w3c.dom.Element getRootElement()

getElementWithAttribute

public org.w3c.dom.Element getElementWithAttribute(java.lang.String elementname,
                                                   java.lang.String attribname,
                                                   java.lang.String attribval)
returns first element on preorder traversal with matching attribname and value


getChildWithAttribute

public static org.w3c.dom.Element getChildWithAttribute(org.w3c.dom.Element parentNode,
                                                        java.lang.String childname,
                                                        java.lang.String attribname,
                                                        java.lang.String attribval)
get the element that is a child of parentNode


getChildName

public static org.w3c.dom.Element getChildName(org.w3c.dom.Element parentNode,
                                               java.lang.String childname)
return the first element of child of parent node


getChildrenNamed

public static org.w3c.dom.Element[] getChildrenNamed(org.w3c.dom.Element parentNode,
                                                     java.lang.String childName)
Get a list of Elements that are children of the parent and with the given name


getAllElementsWithAttribute

public org.w3c.dom.Element[] getAllElementsWithAttribute(java.lang.String elementname,
                                                         java.lang.String attribname,
                                                         java.lang.String attribval)
returns all nodes with elementname having matching attribute and value


getAllChildrenWithAttribute

public org.w3c.dom.Element[] getAllChildrenWithAttribute(org.w3c.dom.Element root,
                                                         java.lang.String elementname,
                                                         java.lang.String attribname,
                                                         java.lang.String attribval)
returns all nodes of root with elementname having matching attribute and value


getAllChildrenWithAttributeName

public org.w3c.dom.Element[] getAllChildrenWithAttributeName(org.w3c.dom.Element root,
                                                             java.lang.String elementname,
                                                             java.lang.String attribname)
returns all nodes of root with elementname having matching attributename


getAllElementsWithAttributeName

public org.w3c.dom.Element[] getAllElementsWithAttributeName(java.lang.String elementname,
                                                             java.lang.String attribname)
returns all nodes with elementname having matching attributenam


toString

public java.lang.String toString()
Serialize Content to String