public class XMLUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
logger
This is a custom XML handler to load the dtds from the classpath
This should be used by all the xml parsing document builders to
set the default entity resolvers.
|
protected static SOAPFactory |
soapFactory |
| Constructor and Description |
|---|
XMLUtil() |
| Modifier and Type | Method and Description |
|---|---|
static SOAPElement |
convertToSoapElement(Document doc,
Element elem)
convertToSoapElement
|
static String |
convertToXpath(String qname) |
static Element |
createElement(Document doc,
String tag,
String nsURI,
String prefix) |
static byte[] |
getDecodedBase64EncodedData(String encodedData) |
static org.apache.xml.security.keys.content.keyvalues.DSAKeyValue |
getDSAKeyValue(Document doc,
X509Certificate cert) |
static List |
getElementsByTagNameNS1(Element element,
String nsName,
String tagName)
This method searches children of Element element for element with tagName
and namespaceURI nsName.
|
static Element |
getFirstChildElement(Node node) |
static String |
getFullTextFromChildren(Element element) |
static Document |
getOwnerDocument(Node node) |
static org.apache.xml.security.keys.content.keyvalues.RSAKeyValue |
getRSAKeyValue(Document doc,
X509Certificate cert) |
static org.apache.xml.security.keys.content.X509Data |
getX509Data(Document doc,
X509Certificate cert) |
static boolean |
hasElementChild(Node node)
Checks if a node has a child of ELEMENT type.
|
static boolean |
inEncryptionNS(SOAPElement element) |
static boolean |
inSamlNSv1_0(SOAPElement element) |
static boolean |
inSamlNSv1_1(SOAPElement element) |
static boolean |
inSamlNSv2_0(SOAPElement element) |
static boolean |
inSignatureNS(SOAPElement element) |
static boolean |
inWSS11_NS(SOAPElement element) |
static boolean |
inWsscNS(SOAPElement element) |
static boolean |
inWsse11NS(SOAPElement element) |
static boolean |
inWsseNS(SOAPElement element) |
static boolean |
inWsuNS(SOAPElement element) |
static Document |
newDocument()
Obtains a new instance of a DOM Document object
|
static Element |
prependChildElement(Element parent,
Element child,
boolean addWhitespace,
Document doc) |
static Element |
prependChildElement(Element parent,
Element child,
Document doc) |
static String |
print(Node node)
Print a Node tree recursively.
|
static String |
resolveXPath(Node element) |
static void |
setIdAttr(Element element,
String Id) |
static void |
setWsuIdAttr(Element element,
String wsuId) |
static Document |
toDOMDocument(InputStream is)
Converts the XML document from an input stream to DOM Document format.
|
static Document |
toDOMDocument(String xmlString)
Converts the XML document from a String format to DOM Document format.
|
protected static final Logger logger
protected static SOAPFactory soapFactory
public static SOAPElement convertToSoapElement(Document doc, Element elem) throws DOMException, ClassCastException
doc - the Owner Soap Document of the SOAPElement to be returnedelem - the DOM Element to be converted to SOAPElementDOMExceptionClassCastExceptionpublic static List getElementsByTagNameNS1(Element element, String nsName, String tagName)
element - The root elementnsName - NamespaceURItagName - A String representing the name of the tag to be searched
for.public static boolean inEncryptionNS(SOAPElement element)
public static boolean inSamlNSv1_0(SOAPElement element)
public static boolean inSamlNSv2_0(SOAPElement element)
public static boolean inSamlNSv1_1(SOAPElement element)
public static boolean inSignatureNS(SOAPElement element)
public static boolean inWsseNS(SOAPElement element)
public static boolean inWsscNS(SOAPElement element)
public static boolean inWsse11NS(SOAPElement element)
public static boolean inWSS11_NS(SOAPElement element)
public static boolean inWsuNS(SOAPElement element)
public static Element prependChildElement(Element parent, Element child, boolean addWhitespace, Document doc)
public static Element prependChildElement(Element parent, Element child, Document doc)
public static String print(Node node)
node - A DOM tree Nodepublic static Document toDOMDocument(InputStream is)
is - is the InputStream that contains XML documentpublic static Document toDOMDocument(String xmlString)
xmlString - is the XML document in a String formatpublic static Document newDocument() throws ParserConfigurationException
Exception - if an error occurs while constructing a new
documentParserConfigurationExceptionpublic static boolean hasElementChild(Node node)
node - a nodepublic static org.apache.xml.security.keys.content.keyvalues.DSAKeyValue getDSAKeyValue(Document doc, X509Certificate cert) throws XWSSecurityException
XWSSecurityExceptionpublic static org.apache.xml.security.keys.content.keyvalues.RSAKeyValue getRSAKeyValue(Document doc, X509Certificate cert) throws XWSSecurityException
XWSSecurityExceptionpublic static org.apache.xml.security.keys.content.X509Data getX509Data(Document doc, X509Certificate cert) throws XWSSecurityException
XWSSecurityExceptionpublic static byte[] getDecodedBase64EncodedData(String encodedData) throws XWSSecurityException
XWSSecurityExceptionCopyright © 2005–2018 Oracle Corporation. All rights reserved.