Save This Page
Home » commons-modeler-2.0.1-src » org.apache.commons » modeler » util » [javadoc | source]
org.apache.commons.modeler.util
public class: DomUtil [javadoc | source]
java.lang.Object
   org.apache.commons.modeler.util.DomUtil
Few simple utils to read DOM
Nested Class Summary:
public static class  DomUtil.NullResolver   
Method from org.apache.commons.modeler.util.DomUtil Summary:
findChildWithAtt,   getAttribute,   getChild,   getChild,   getChildContent,   getContent,   getNext,   getNext,   readXml,   removeAttribute,   setAttribute,   setAttributes,   setText,   writeXml
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.modeler.util.DomUtil Detail:
 public static Node findChildWithAtt(Node parent,
    String elemName,
    String attName,
    String attVal) 
    Find the first direct child with a given attribute.
 public static String getAttribute(Node element,
    String attName) 
 public static Node getChild(Node parent,
    String name) 
    Get the first element child.
 public static Node getChild(Node parent,
    int type) 
    Get the first direct child with a given type
 public static String getChildContent(Node parent,
    String name) 
    Get the first child's content ( ie it's included TEXT node ).
 public static String getContent(Node n) 
    Get the trimed text content of a node or null if there is no text
 public static Node getNext(Node current) 
    Get the next sibling with the same name and type
 public static Node getNext(Node current,
    String name,
    int type) 
    Return the next sibling with a given name and type
 public static Document readXml(InputStream is) throws IOException, SAXException, ParserConfigurationException 
    Read XML as DOM.
 public static  void removeAttribute(Node node,
    String attName) 
 public static  void setAttribute(Node node,
    String attName,
    String val) 
 public static  void setAttributes(Object o,
    Node parent) 
 public static  void setText(Node node,
    String val) 
    Set or replace the text value
 public static  void writeXml(Node n,
    OutputStream os) throws TransformerException