org.apache.solr.util
Class DOMUtil

java.lang.Object
  extended by org.apache.solr.util.DOMUtil

public class DOMUtil
extends java.lang.Object

Version:
$Id: DOMUtil.java 542679 2007-05-29 22:28:21Z ryan $
Author:
yonik

Constructor Summary
DOMUtil()
           
 
Method Summary
static void addToNamedList(org.w3c.dom.Node nd, NamedList nlst, java.util.List arr)
           
static java.util.List childNodesToList(org.w3c.dom.Node nd)
           
static NamedList 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().
static java.util.List nodesToList(org.w3c.dom.NodeList nlst)
           
static NamedList nodesToNamedList(org.w3c.dom.NodeList nlst)
           
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMUtil

public DOMUtil()
Method Detail

toMap

public static java.util.Map<java.lang.String,java.lang.String> toMap(org.w3c.dom.NamedNodeMap attrs)

toMapExcept

public static java.util.Map<java.lang.String,java.lang.String> toMapExcept(org.w3c.dom.NamedNodeMap attrs,
                                                                           java.lang.String... exclusions)

getChild

public static org.w3c.dom.Node getChild(org.w3c.dom.Node node,
                                        java.lang.String name)

getAttr

public static java.lang.String getAttr(org.w3c.dom.NamedNodeMap attrs,
                                       java.lang.String name)

getAttr

public static java.lang.String getAttr(org.w3c.dom.Node nd,
                                       java.lang.String name)

getAttr

public static java.lang.String getAttr(org.w3c.dom.NamedNodeMap attrs,
                                       java.lang.String name,
                                       java.lang.String missing_err)

getAttr

public static java.lang.String getAttr(org.w3c.dom.Node node,
                                       java.lang.String name,
                                       java.lang.String missing_err)

childNodesToNamedList

public static NamedList childNodesToNamedList(org.w3c.dom.Node nd)

childNodesToList

public static java.util.List childNodesToList(org.w3c.dom.Node nd)

nodesToNamedList

public static NamedList nodesToNamedList(org.w3c.dom.NodeList nlst)

nodesToList

public static java.util.List nodesToList(org.w3c.dom.NodeList nlst)

addToNamedList

public static void addToNamedList(org.w3c.dom.Node nd,
                                  NamedList nlst,
                                  java.util.List arr)

getText

public static java.lang.String getText(org.w3c.dom.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(org.w3c.dom.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