Package org.apache.solr.common.util
Class DOMUtil
- java.lang.Object
- 
- org.apache.solr.common.util.DOMUtil
 
- 
 public class DOMUtil extends Object 
- 
- 
Field SummaryFields Modifier and Type Field Description static Set<String>NL_TAGSstatic StringXML_RESERVED_PREFIX
 - 
Constructor SummaryConstructors Constructor Description DOMUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddToNamedList(Node nd, NamedList<Object> nlst, List<Object> 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 List<Object>childNodesToList(Node nd)static NamedList<Object>childNodesToNamedList(ConfigNode node)static NamedList<Object>childNodesToNamedList(Node nd)static StringgetAttr(ConfigNode node, String name, String missing_err)static StringgetAttr(NamedNodeMap attrs, String name)static StringgetAttr(NamedNodeMap attrs, String name, String missing_err)static StringgetAttr(Node nd, String name)static StringgetAttr(Node node, String name, String missing_err)static StringgetAttrOrDefault(Node nd, String name, String def)static NodegetChild(Node node, String name)static StringgetText(Node nd)Drop in replacement for Node.getTextContent().static List<Object>nodesToList(NodeList nlst)static NamedList<Object>nodesToNamedList(NodeList nlst)static NamedList<Object>readNamedListChildren(ConfigNode configNode)static voidsubstituteProperties(Node node, Properties properties)Replaces ${property[:default value]} references in all attributes and text nodes of supplied node.static StringsubstituteProperty(String value, Properties coreProperties)static voidsubstituteSystemProperties(Node node)Replaces ${system.property[:default value]} references in all attributes and text nodes of supplied node.static Map<String,String>toMap(ConfigNode node)static Map<String,String>toMap(NamedNodeMap attrs)static Map<String,String>toMapExcept(ConfigNode node, String... exclusions)static Map<String,String>toMapExcept(NamedNodeMap attrs, String... exclusions)
 
- 
- 
- 
Field Detail- 
XML_RESERVED_PREFIXpublic static final String XML_RESERVED_PREFIX - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
toMappublic static Map<String,String> toMap(NamedNodeMap attrs) 
 - 
toMappublic static Map<String,String> toMap(ConfigNode node) 
 - 
toMapExceptpublic static Map<String,String> toMapExcept(ConfigNode node, String... exclusions) 
 - 
toMapExceptpublic static Map<String,String> toMapExcept(NamedNodeMap attrs, String... exclusions) 
 - 
getAttrpublic static String getAttr(NamedNodeMap attrs, String name) 
 - 
getAttrpublic static String getAttr(NamedNodeMap attrs, String name, String missing_err) 
 - 
getAttrpublic static String getAttr(ConfigNode node, String name, String missing_err) 
 - 
childNodesToNamedListpublic static NamedList<Object> childNodesToNamedList(ConfigNode node) 
 - 
addToNamedListpublic static void addToNamedList(Node nd, NamedList<Object> nlst, List<Object> 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.- Parameters:
- 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 NamedList
- nlst- 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.
 
 - 
readNamedListChildrenpublic static NamedList<Object> readNamedListChildren(ConfigNode configNode) 
 - 
getTextpublic 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
 
 - 
substituteSystemPropertiespublic 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
 
 - 
substitutePropertiespublic static void substituteProperties(Node node, Properties properties) Replaces ${property[:default value]} references in all attributes and text nodes of supplied node. If the property is not defined neither in the given Properties instance nor in System.getProperty and no default value is provided, a runtime exception is thrown.- Parameters:
- node- DOM node to walk for substitutions
- properties- the Properties instance from which a value can be looked up
 
 - 
substitutePropertypublic static String substituteProperty(String value, Properties coreProperties) 
 
- 
 
-