public class DOMUtils extends Object
Constructor and Description |
---|
DOMUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
cleanString(String orig) |
static int |
countKids(Element elem,
short nodeType)
Count number of children of a certain type of the given element.
|
static Element |
findChildElementWithAttribute(Element elem,
String attrName,
String attrValue)
Return the first child element of the given element which has the
given attribute with the given value.
|
static String |
getAttribute(Element el,
String attrName)
Returns the value of an attribute of an element.
|
static String |
getAttribute(Element el,
String attrName,
List remainingAttrs)
Returns the value of an attribute of an element.
|
static String |
getAttributeNS(Element el,
String namespaceURI,
String localPart)
Returns the value of an attribute of an element.
|
static List |
getAttributes(Element el)
Returns a list of attributes of an element.
|
static String |
getChildCharacterData(Element parentEl)
Concat all the text and cdata node children of this elem and return
the resulting text.
|
static Element |
getFirstChildElement(Element elem)
Return the first child element of the given element.
|
static Element |
getNextSiblingElement(Element elem)
Return the next sibling element of the given element.
|
static String |
getQualifiedValue(String namespaceURI,
String localPart,
WSDLElement elem) |
static String |
getQualifiedValue(URI namespaceURI,
String localPart,
WSDLElement elem) |
static void |
printAttribute(String name,
String value,
PrintWriter pw) |
static void |
printQualifiedAttribute(String name,
QName value,
WSDLElement elem,
PrintWriter pw)
Prints attributes with qualified names.
|
static void |
throwWSDLException(Element location) |
static void |
throwWSDLException(Element location,
List remainingAttrs) |
public static List getAttributes(Element el)
el
- Element whose attributes are returnedpublic static String getAttribute(Element el, String attrName)
el
- Element whose attrib is looked forattrName
- name of attribute to look forpublic static String getAttribute(Element el, String attrName, List remainingAttrs)
el
- Element whose attrib is looked forattrName
- name of attribute to look forremainingAttrs
- List of remaining attributespublic static String getAttributeNS(Element el, String namespaceURI, String localPart)
el
- Element whose attrib is looked fornamespaceURI
- namespace URI of attribute to look forlocalPart
- local part of attribute to look forpublic static String getChildCharacterData(Element parentEl)
parentEl
- the element whose cdata/text node values are to
be combined.public static Element getFirstChildElement(Element elem)
elem
- Element whose child is to be returnedpublic static Element getNextSiblingElement(Element elem)
elem
- Element whose sibling element is to be returnedpublic static Element findChildElementWithAttribute(Element elem, String attrName, String attrValue)
elem
- the element whose children are to be searchedattrName
- the attrib that must be presentattrValue
- the desired value of the attributepublic static int countKids(Element elem, short nodeType)
elem
- the element whose kids are to be countedpublic static void throwWSDLException(Element location) throws WSDLException
WSDLException
public static void throwWSDLException(Element location, List remainingAttrs) throws WSDLException
WSDLException
public static void printAttribute(String name, String value, PrintWriter pw)
public static void printQualifiedAttribute(String name, QName value, WSDLElement elem, PrintWriter pw) throws WSDLException
WSDLException
public static String getQualifiedValue(URI namespaceURI, String localPart, WSDLElement elem) throws WSDLException
WSDLException
public static String getQualifiedValue(String namespaceURI, String localPart, WSDLElement elem) throws WSDLException
WSDLException
Copyright © 2005–2015 Apache Software Foundation. All rights reserved.