public class DOMUtil
extends java.lang.Object
Constructor and Description |
---|
DOMUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addToNamedList(org.w3c.dom.Node nd,
NamedList nlst,
java.util.List arr)
Examines a Node from the DOM representation of a NamedList and adds the
contents of that node to both the specified NamedList and List passed
as arguments.
|
static java.util.List |
childNodesToList(org.w3c.dom.Node nd) |
static NamedList<java.lang.Object> |
childNodesToNamedList(org.w3c.dom.Node nd) |
static java.lang.String |
getAttr(org.w3c.dom.NamedNodeMap attrs,
java.lang.String name) |
static java.lang.String |
getAttr(org.w3c.dom.NamedNodeMap attrs,
java.lang.String name,
java.lang.String missing_err) |
static java.lang.String |
getAttr(org.w3c.dom.Node nd,
java.lang.String name) |
static java.lang.String |
getAttr(org.w3c.dom.Node node,
java.lang.String name,
java.lang.String missing_err) |
static org.w3c.dom.Node |
getChild(org.w3c.dom.Node node,
java.lang.String name) |
static java.lang.String |
getText(org.w3c.dom.Node nd)
Drop in replacement for Node.getTextContent().
|
private static void |
getText(org.w3c.dom.Node nd,
java.lang.StringBuilder buf) |
static java.util.List |
nodesToList(org.w3c.dom.NodeList nlst) |
static NamedList<java.lang.Object> |
nodesToNamedList(org.w3c.dom.NodeList nlst) |
private static void |
parsePropertyString(java.lang.String value,
java.util.List<java.lang.String> fragments,
java.util.List<java.lang.String> propertyRefs) |
static void |
substituteProperties(org.w3c.dom.Node node,
java.util.Properties properties)
Replaces ${property[:default value]} references in all attributes
and text nodes of supplied node.
|
private static java.lang.String |
substituteProperty(java.lang.String value,
java.util.Properties coreProperties) |
static void |
substituteSystemProperties(org.w3c.dom.Node node)
Replaces ${system.property[:default value]} references in all attributes
and text nodes of supplied node.
|
static java.util.Map<java.lang.String,java.lang.String> |
toMap(org.w3c.dom.NamedNodeMap attrs) |
static java.util.Map<java.lang.String,java.lang.String> |
toMapExcept(org.w3c.dom.NamedNodeMap attrs,
java.lang.String... exclusions) |
public static java.util.Map<java.lang.String,java.lang.String> toMap(org.w3c.dom.NamedNodeMap attrs)
public static java.util.Map<java.lang.String,java.lang.String> toMapExcept(org.w3c.dom.NamedNodeMap attrs, java.lang.String... exclusions)
public static org.w3c.dom.Node getChild(org.w3c.dom.Node node, java.lang.String name)
public static java.lang.String getAttr(org.w3c.dom.NamedNodeMap attrs, java.lang.String name)
public static java.lang.String getAttr(org.w3c.dom.Node nd, java.lang.String name)
public static java.lang.String getAttr(org.w3c.dom.NamedNodeMap attrs, java.lang.String name, java.lang.String missing_err)
public static java.lang.String getAttr(org.w3c.dom.Node node, java.lang.String name, java.lang.String missing_err)
public static NamedList<java.lang.Object> childNodesToNamedList(org.w3c.dom.Node nd)
public static java.util.List childNodesToList(org.w3c.dom.Node nd)
public static NamedList<java.lang.Object> nodesToNamedList(org.w3c.dom.NodeList nlst)
public static java.util.List nodesToList(org.w3c.dom.NodeList nlst)
public static void addToNamedList(org.w3c.dom.Node nd, NamedList nlst, java.util.List arr)
nd
- The Node whose type will be used to determine how to parse the
text content. If there is a 'name' attribute it will be used
when adding to the NamedListnlst
- A NamedList to add the item to with name if application.
If this param is null it will be ignored.arr
- A List to add the item to.
If this param is null it will be ignored.public static java.lang.String getText(org.w3c.dom.Node nd)
This method is provided to support the same functionality as Node.getTextContent() but in a way that is DOM Level 2 compatible.
private static void getText(org.w3c.dom.Node nd, java.lang.StringBuilder buf)
getText(Node)
public static void substituteSystemProperties(org.w3c.dom.Node node)
node
- DOM node to walk for substitutionspublic static void substituteProperties(org.w3c.dom.Node node, java.util.Properties properties)
node
- DOM node to walk for substitutionsproperties
- the Properties instance from which a value can be looked upprivate static java.lang.String substituteProperty(java.lang.String value, java.util.Properties coreProperties)
private static void parsePropertyString(java.lang.String value, java.util.List<java.lang.String> fragments, java.util.List<java.lang.String> propertyRefs)