public class DocumentUtils
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static java.util.List<org.w3c.dom.Element> |
getChildElements(org.w3c.dom.Element entityItemElement,
java.lang.String elementName) |
Search in the children of the element specified all elements with the name specified .
|
static java.util.List<java.lang.String> |
getChildElementsAttributeValues(org.w3c.dom.Element entityItemElement,
java.lang.String elementName,
java.lang.String attribute) |
Search in the children of the element specified all elements with the name specified
and returns the specified attribute from all of them.
|
static java.util.Set<java.lang.String> |
getChildElementsTextContents(org.w3c.dom.Element entityItemElement,
java.lang.String elementName) |
Search in the children of the element specified all elements with the name specified and returns text contents from all of them.
|
static org.w3c.dom.Element |
getSingleChildElement(org.w3c.dom.Element entityItemElement,
java.lang.String elementName) |
Search in the children of the element specified a single element with the name specified.
|
static org.w3c.dom.Element |
getSingleChildElement(org.w3c.dom.Element entityItemElement,
java.lang.String elementName,
boolean optional) |
Search in the children of the element specified a single element with the name specified .
|
static java.lang.String |
getSingleChildElementAttribute(org.w3c.dom.Element entityItemElement,
java.lang.String elementName,
java.lang.String attributeName) |
Search in the children of the element specified a single element with the name specified and returns the value from the attribute specified.
|
static java.lang.String |
getSingleChildElementTextContent(org.w3c.dom.Element entityItemElement,
java.lang.String elementName) |
Search in the children of the element specified a single element with the name specified and returns its text content.
|
static org.w3c.dom.Element |
getSingleElement(org.w3c.dom.Element entityItemElement,
java.lang.String entityName) |
Search in the children of the element specified a single element with the name specified.
|
static org.w3c.dom.Element |
stringToXML(DocumentTools documentTools,
java.lang.String string) |
Generate dom Element from a XML String.
|
public static org.w3c.dom.Element stringToXML(DocumentTools documentTools, java.lang.String string) throws DocumentParseException
documentTools - DocumentTools instance used for parsingstring - xml StringDocumentParseException - if any errorspublic static org.w3c.dom.Element getSingleElement(org.w3c.dom.Element entityItemElement,
java.lang.String entityName)
entityItemElement - element to search intoentityName - element name to searchBundleBuilderException - if not found, multiple found or invalid node type found (not element)public static org.w3c.dom.Element getSingleChildElement(org.w3c.dom.Element entityItemElement,
java.lang.String elementName)
entityItemElement - element to search intoelementName - element name to searchBundleBuilderException - if not found, multiple found or invalid node type found (not element)public static org.w3c.dom.Element getSingleChildElement(org.w3c.dom.Element entityItemElement,
java.lang.String elementName,
boolean optional)
entityItemElement - element to search intoelementName - element name to searchoptional - if not found returns null instead of throwing exceptionBundleBuilderException - if multiple found or invalid node type found (not element)public static java.lang.String getSingleChildElementTextContent(org.w3c.dom.Element entityItemElement,
java.lang.String elementName)
entityItemElement - element to search intoelementName - element name to searchBundleBuilderException - if multiple found or invalid node type found (not element)public static java.lang.String getSingleChildElementAttribute(org.w3c.dom.Element entityItemElement,
java.lang.String elementName,
java.lang.String attributeName)
entityItemElement - element to search intoelementName - element name to searchattributeName - attribute name to get valuepublic static java.util.List<org.w3c.dom.Element> getChildElements(org.w3c.dom.Element entityItemElement,
java.lang.String elementName)
entityItemElement - element to search intoelementName - element name to searchpublic static java.util.Set<java.lang.String> getChildElementsTextContents(org.w3c.dom.Element entityItemElement,
java.lang.String elementName)
entityItemElement - element to search intoelementName - element name to searchpublic static java.util.List<java.lang.String> getChildElementsAttributeValues(org.w3c.dom.Element entityItemElement,
java.lang.String elementName,
java.lang.String attribute)
entityItemElement - element to search intoelementName - element name to searchattribute - attribute to search