| java.lang.Object org.apache.commons.modeler.util.DomUtil
DomUtil | public class DomUtil (Code) | | Few simple utils to read DOM
author: Costin Manolache |
Inner Class :public static class NullResolver implements EntityResolver | |
Method Summary | |
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.
Parameters: parent - lookup direct childs Parameters: name - name of the element. | public static Node | getChild(Node parent, int 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) | public static Node | getNext(Node current) | public static Node | getNext(Node current, String name, int type) | public static Document | readXml(InputStream is) 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) | public static void | writeXml(Node n, OutputStream os) |
findChildWithAtt | public static Node findChildWithAtt(Node parent, String elemName, String attName, String attVal)(Code) | | Find the first direct child with a given attribute.
Parameters: parent - Parameters: elemName - name of the element, or null for any Parameters: attName - attribute we're looking for Parameters: attVal - attribute value or null if we just want any |
getChild | public static Node getChild(Node parent, String name)(Code) | | Get the first element child.
Parameters: parent - lookup direct childs Parameters: name - name of the element. If null return the first element. |
getChild | public static Node getChild(Node parent, int type)(Code) | | Get the first direct child with a given type
|
getChildContent | public static String getChildContent(Node parent, String name)(Code) | | Get the first child's content ( ie it's included TEXT node ).
|
getContent | public static String getContent(Node n)(Code) | | Get the trimed text content of a node or null if there is no text
|
getNext | public static Node getNext(Node current)(Code) | | Get the next sibling with the same name and type
|
getNext | public static Node getNext(Node current, String name, int type)(Code) | | Return the next sibling with a given name and type
|
removeAttribute | public static void removeAttribute(Node node, String attName)(Code) | | |
setText | public static void setText(Node node, String val)(Code) | | Set or replace the text value
|
|
|