Class DOMUtils
java.lang.Object
org.apache.lucene.queryparser.xml.DOMUtils
Helper methods for parsing XML.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetAttribute(Element element, String attributeName, boolean deflt) static floatgetAttribute(Element element, String attributeName, float deflt) static intgetAttribute(Element element, String attributeName, int deflt) static StringgetAttribute(Element element, String attributeName, String deflt) static StringgetAttributeOrFail(Element e, String name) static StringgetAttributeWithInheritance(Element element, String attributeName) Returns an attribute value from this node, or first parent node with this attribute definedstatic Stringstatic ElementgetChildByTagName(Element e, String name) static ElementgetChildByTagOrFail(Element e, String name) static StringgetChildTextByTagName(Element e, String tagName) static ElementgetFirstChildElement(Element element) static Elementstatic Stringstatic Stringstatic ElementinsertChild(Element parent, String tagName, String text)
-
Method Details
-
getChildByTagOrFail
- Throws:
ParserException
-
getFirstChildOrFail
- Throws:
ParserException
-
getAttributeOrFail
- Throws:
ParserException
-
getAttributeWithInheritanceOrFail
public static String getAttributeWithInheritanceOrFail(Element e, String name) throws ParserException - Throws:
ParserException
-
getNonBlankTextOrFail
- Throws:
ParserException
-
getChildByTagName
-
getAttributeWithInheritance
Returns an attribute value from this node, or first parent node with this attribute defined- Returns:
- A non-zero-length value if defined, otherwise null
-
getChildTextByTagName
-
insertChild
-
getAttribute
-
getAttribute
-
getAttribute
-
getAttribute
-
getText
-
getFirstChildElement
-