public class DomParser extends Object
| Constructor and Description |
|---|
DomParser() |
public static List<Element> getSubElements(Node container, String... elementNames)
elementNames - can be "*"public static void assertNoOtherElements(Node container, String... elements) throws ConfigurationException
ConfigurationExceptionpublic static String getMandatoryAttribute(Element node, String attributeName) throws ConfigurationException
ConfigurationExceptionpublic static String getOptionalAttribute(Element node, String attributeName, String defaultValue)
public static String getOptionalAttribute(Element node, String attributeName)
public static double parseMandatoryDoubleAttribute(Element node, String attributeName) throws ConfigurationException
ConfigurationExceptionpublic static Integer parseOptionalIntegerAttribute(Element node, String attributeName) throws ConfigurationException
ConfigurationExceptionpublic static int parseOptionalIntAttribute(Element node, String attributeName, int defaultValue) throws ConfigurationException
ConfigurationExceptionpublic static Element getMandatorySingleSubElement(Node node, String subNodeName) throws ConfigurationException
subNodeName - can be "*"ConfigurationException - if more than one element foundpublic static Element getOptionalSingleSubElement(Element node, String subNodeName) throws ConfigurationException
subNodeName - can be "*"ConfigurationException - if more than one element foundpublic static String getOptionalSingleSubElementTextContent(Element node, String subNodeName) throws ConfigurationException
subNodeName - can be "*"ConfigurationException - if more than one element foundpublic static List<String> parseList(Element container, String elementName, String attribute) throws ConfigurationException
ConfigurationExceptionpublic static Set<String> parseSet(Element container, String elementName, String attribute) throws ConfigurationException
ConfigurationExceptionpublic static List<String> parseList(Element container, String elementName) throws ConfigurationException
ConfigurationExceptionpublic static Set<String> parseSet(Element container, String elementName) throws ConfigurationException
ConfigurationExceptionpublic static Map<String,String> parseMap(Element container, String elementName, String keyAttribute, String valueAttribute) throws ConfigurationException
ConfigurationExceptionpublic static Map<String,String> parseMap(Element container, String elementName, String keyAttribute) throws ConfigurationException
ConfigurationExceptionpublic static Map<String,Double> parseDoubleMap(Element container, String elementName, String keyAttribute, String valueAttribute) throws ConfigurationException
ConfigurationExceptionpublic static XPathExpression getExpression(String expression) throws XPathExpressionException
XPathExpressionExceptionpublic static NodeList getNodesFromXPath(Document document, String expression) throws XPathExpressionException
XPathExpressionExceptionpublic static NodeList getNodesFromXPath(Element root, String expression) throws XPathExpressionException
XPathExpressionExceptionpublic static List<Element> getElementsFromXPath(Document document, String expression) throws XPathExpressionException
XPathExpressionExceptionpublic static List<Element> getElementsFromXPath(Element root, String expression) throws XPathExpressionException
XPathExpressionExceptionpublic static Element getElementFromXPath(Document document, String expression) throws XPathExpressionException
XPathExpressionExceptionpublic static Element getElementFromXPath(Element root, String expression) throws XPathExpressionException
XPathExpressionExceptionpublic static Element from(File f) throws ConfigurationException
ConfigurationExceptionpublic static Element from(InputStream f) throws ConfigurationException
ConfigurationExceptionpublic static DocumentBuilder newDocumentBuilder()
Copyright © 2003–2018. All rights reserved.