org.apache.solr.util
Class DOMUtil
java.lang.Object
org.apache.solr.util.DOMUtil
public class DOMUtil
- extends Object
- Version:
- $Id: DOMUtil.java 542679 2007-05-29 22:28:21Z ryan $
- Author:
- yonik
Method Summary |
static void |
addToNamedList(Node nd,
NamedList nlst,
List arr)
|
static List |
childNodesToList(Node nd)
|
static NamedList |
childNodesToNamedList(Node nd)
|
static String |
getAttr(NamedNodeMap attrs,
String name)
|
static String |
getAttr(NamedNodeMap attrs,
String name,
String missing_err)
|
static String |
getAttr(Node nd,
String name)
|
static String |
getAttr(Node node,
String name,
String missing_err)
|
static Node |
getChild(Node node,
String name)
|
static String |
getText(Node nd)
Drop in replacement for Node.getTextContent(). |
static List |
nodesToList(NodeList nlst)
|
static NamedList |
nodesToNamedList(NodeList nlst)
|
static void |
substituteSystemProperties(Node node)
Replaces ${system.property[:default value]} references in all attributes
and text nodes of supplied node. |
static Map<String,String> |
toMap(NamedNodeMap attrs)
|
static Map<String,String> |
toMapExcept(NamedNodeMap attrs,
String... exclusions)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DOMUtil
public DOMUtil()
toMap
public static Map<String,String> toMap(NamedNodeMap attrs)
toMapExcept
public static Map<String,String> toMapExcept(NamedNodeMap attrs,
String... exclusions)
getChild
public static Node getChild(Node node,
String name)
getAttr
public static String getAttr(NamedNodeMap attrs,
String name)
getAttr
public static String getAttr(Node nd,
String name)
getAttr
public static String getAttr(NamedNodeMap attrs,
String name,
String missing_err)
getAttr
public static String getAttr(Node node,
String name,
String missing_err)
childNodesToNamedList
public static NamedList childNodesToNamedList(Node nd)
childNodesToList
public static List childNodesToList(Node nd)
nodesToNamedList
public static NamedList nodesToNamedList(NodeList nlst)
nodesToList
public static List nodesToList(NodeList nlst)
addToNamedList
public static void addToNamedList(Node nd,
NamedList nlst,
List arr)
getText
public static String getText(Node nd)
- Drop in replacement for Node.getTextContent().
This method is provided to support the same functionality as
Node.getTextContent() but in a way that is DOM Level 2 compatible.
- See Also:
- DOM Object Model Core
substituteSystemProperties
public static void substituteSystemProperties(Node node)
- Replaces ${system.property[:default value]} references in all attributes
and text nodes of supplied node. If the system property is not defined and no
default value is provided, a runtime exception is thrown.
- Parameters:
node
- DOM node to walk for substitutions
Copyright © 2006 - 2009 The Apache Software Foundation