Package org.openremote.container.xml
Class DOMElement<CHILD extends DOMElement,PARENT extends DOMElement>
java.lang.Object
org.openremote.container.xml.DOMElement<CHILD,PARENT>
Wraps a W3C element.
Using XPath for simple queries like "get all children with attribute value X" is actually slower than iterating with the W3C API. We still use XPath because there is a small chance that the authors of the XML implementation in the JDK will not get forced by Larry to fix their ugly code and APIs. Yes, it' s unlikely but one can dream...
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
DOMElement.ArrayBuilder<T extends DOMElement>
class
DOMElement.Builder<T extends DOMElement>
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DOMElement<CHILD,
PARENT>.ArrayBuilder<CHILD> final DOMElement<CHILD,
PARENT>.Builder<PARENT> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CHILD
adoptOrImport
(Document document, CHILD child, boolean copy) appendChild
(CHILD el, boolean copy) createChild
(String name) createChild
(String name, String namespaceURI) protected abstract DOMElement<CHILD,
PARENT>.ArrayBuilder<CHILD> protected abstract DOMElement<CHILD,
PARENT>.Builder<PARENT> CHILD[]
findChildren
(String name) getAttribute
(String attribute) CHILD[]
CHILD[]
getChildren
(String name) getFirstChild
(String name) getRequiredChild
(String name) getXpath()
getXPathChildElement
(DOMElement<CHILD, PARENT>.Builder<CHILD> builder, String expr) getXPathChildElements
(DOMElement<CHILD, PARENT>.Builder<CHILD> builder, String expr) getXPathElements
(DOMElement.Builder builder, String expr) getXPathParentElement
(DOMElement<CHILD, PARENT>.Builder<PARENT> builder, String expr) getXPathParentElements
(DOMElement<CHILD, PARENT>.Builder<CHILD> builder, String expr) getXPathResult
(String expr, QName result) getXPathResult
(Node context, String expr, QName result) getXPathString
(XPath xpath, String expr) protected String
void
removeChild
(CHILD el) void
replaceChild
(CHILD original, CHILD replacement, boolean copy) void
replaceEqualChild
(DOMElement source, String identifier) setAttribute
(String attribute, String value) setContent
(String content) toString()
-
Field Details
-
PARENT_BUILDER
public final DOMElement<CHILD extends DOMElement,PARENT extends DOMElement>.Builder<PARENT extends DOMElement> PARENT_BUILDER -
CHILD_BUILDER
public final DOMElement<CHILD extends DOMElement,PARENT extends DOMElement>.ArrayBuilder<CHILD extends DOMElement> CHILD_BUILDER
-
-
Constructor Details
-
DOMElement
-
-
Method Details
-
getW3CElement
-
getElementName
-
getContent
-
setContent
-
getAttribute
-
setAttribute
-
getParent
-
getChildren
-
getChildren
-
getRequiredChild
- Throws:
ParserException
-
findChildren
-
findChildWithIdentifier
-
getFirstChild
-
createChild
-
createChild
-
appendChild
-
replaceChild
-
replaceEqualChild
-
removeChild
-
removeChildren
public void removeChildren() -
adoptOrImport
-
createParentBuilder
-
createChildBuilder
-
toSimpleXMLString
-
toString
-
getXpath
-
prefix
-
getXPathParentElements
public Collection<PARENT> getXPathParentElements(DOMElement<CHILD, PARENT>.Builder<CHILD> builder, String expr) -
getXPathChildElements
public Collection<CHILD> getXPathChildElements(DOMElement<CHILD, PARENT>.Builder<CHILD> builder, String expr) -
getXPathParentElement
-
getXPathChildElement
-
getXPathElements
-
getXPathString
-
getXPathResult
-
getXPathResult
-