| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jcp.xml.dsig.internal.dom.DOMUtils
public class DOMUtils
Disabled: no SafeJ information.
Useful static DOM utility methods.
| Method Summary | |
|---|---|
| static void | appendChild(org.w3c.dom.Node parent,
            org.w3c.dom.Node child)Checks if child element has same owner document before appending to the parent, and imports it to the parent's document if necessary. | 
| static org.w3c.dom.Element | createElement(org.w3c.dom.Document doc,
              String tag,
              String nsURI,
              String prefix)Creates an element in the specified namespace, with the specified tag and namespace prefix. | 
| static String | getAttributeValue(org.w3c.dom.Element elem,
                  String name)Returns the attribute value for the attribute with the specified name. | 
| static org.w3c.dom.Element | getFirstChildElement(org.w3c.dom.Node node)Returns the first child element of the specified node, or null if there is no such element. | 
| static org.w3c.dom.Element | getLastChildElement(org.w3c.dom.Node node)Returns the last child element of the specified node, or null if there is no such element. | 
| static org.w3c.dom.Element | getNextSiblingElement(org.w3c.dom.Node node)Returns the next sibling element of the specified node, or null if there is no such element. | 
| static String | getNSPrefix(XMLCryptoContext context,
            String nsURI)Returns the prefix associated with the specified namespace URI | 
| static org.w3c.dom.Document | getOwnerDocument(org.w3c.dom.Node node)Returns the owner document of the specified node. | 
| static String | getSignaturePrefix(XMLCryptoContext context)Returns the prefix associated with the XML Signature namespace URI | 
| static boolean | nodesEqual(org.w3c.dom.Node thisNode,
           org.w3c.dom.Node otherNode)Compares 2 nodes for equality. | 
| static Set | nodeSet(org.w3c.dom.NodeList nl)Returns a Set of Nodes, backed by the specifiedNodeList. | 
| static boolean | paramsEqual(AlgorithmParameterSpec spec1,
            AlgorithmParameterSpec spec2) | 
| static void | removeAllChildren(org.w3c.dom.Node node)Removes all children nodes from the specified node. | 
| static void | setAttribute(org.w3c.dom.Element elem,
             String name,
             String value)Sets an element's attribute (using DOM level 2) with the specified value and namespace prefix. | 
| static void | setAttributeID(org.w3c.dom.Element elem,
               String name,
               String value)Sets an element's attribute (using DOM level 2) with the specified value and namespace prefix AND registers the ID value with the specified element. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static org.w3c.dom.Document getOwnerDocument(org.w3c.dom.Node node)
node - the node
public static org.w3c.dom.Element createElement(org.w3c.dom.Document doc,
                                                String tag,
                                                String nsURI,
                                                String prefix)
doc - the owner documenttag - the tagnsURI - the namespace URIprefix - the namespace prefix
public static void setAttribute(org.w3c.dom.Element elem,
                                String name,
                                String value)
elem - the element to set the attribute onname - the name of the attributevalue - the attribute value. If null, no attribute is set.public static void setAttributeID(org.w3c.dom.Element elem,
                                  String name,
                                  String value)
elem - the element to set the attribute onname - the name of the attributevalue - the attribute value. If null, no attribute is set.public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node node)
node - the node
NullPointerException - if node == nullpublic static org.w3c.dom.Element getLastChildElement(org.w3c.dom.Node node)
node - the node
NullPointerException - if node == nullpublic static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node)
node - the node
NullPointerException - if node == nullpublic static String getAttributeValue(org.w3c.dom.Element elem,
                                       String name)
This works around a limitation of the DOM
 Element.getAttributeNode method, which does not distinguish
 between an unspecified attribute and an attribute with a value of
 "" (it returns "" for both cases).
elem - the element containing the attributename - the name of the attribute
public static Set nodeSet(org.w3c.dom.NodeList nl)
Nodes, backed by the specified
 NodeList.
nl - the NodeList
public static String getNSPrefix(XMLCryptoContext context,
                                 String nsURI)
context - contains the namespace mapnsURI - the namespace URI
public static String getSignaturePrefix(XMLCryptoContext context)
context - contains the namespace map
public static void removeAllChildren(org.w3c.dom.Node node)
node - the parent node whose children are to be removedpublic static boolean nodesEqual(org.w3c.dom.Node thisNode,
                                 org.w3c.dom.Node otherNode)
public static void appendChild(org.w3c.dom.Node parent,
                               org.w3c.dom.Node child)
public static boolean paramsEqual(AlgorithmParameterSpec spec1,
                                  AlgorithmParameterSpec spec2)
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||