soappartimpl.java

来自「开源的axis2框架的源码。用于开发WEBSERVER」· Java 代码 · 共 1,226 行 · 第 1/5 页

JAVA
1,226
字号
        return document.hasChildNodes();
    }

    /**
     * Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The
     * duplicate node has no parent; ( <code>parentNode</code> is <code>null</code>.). <br>Cloning
     * an <code>Element</code> copies all attributes and their values, including those generated by
     * the XML processor to represent defaulted attributes, but this method does not copy any text
     * it contains unless it is a deep clone, since the text is contained in a child
     * <code>Text</code> node. Cloning an <code>Attribute</code> directly, as opposed to be cloned
     * as part of an <code>Element</code> cloning operation, returns a specified attribute (
     * <code>specified</code> is <code>true</code>). Cloning any other type of node simply returns a
     * copy of this node. <br>Note that cloning an immutable subtree results in a mutable copy, but
     * the children of an <code>EntityReference</code> clone are readonly . In addition, clones of
     * unspecified <code>Attr</code> nodes are specified. And, cloning <code>Document</code>,
     * <code>DocumentType</code>, <code>Entity</code>, and <code>Notation</code> nodes is
     * implementation dependent.
     *
     * @param deep If <code>true</code>, recursively clone the subtree under the specified node; if
     *             <code>false</code>, clone only the node itself (and its attributes, if it is an
     *             <code>Element</code>).
     * @return The duplicate node.
     */
    public Node cloneNode(boolean deep) {
        return document.cloneNode(deep);
    }

    /**
     * Puts all <code>Text</code> nodes in the full depth of the sub-tree underneath this
     * <code>Node</code>, including attribute nodes, into a "normal" form where only structure
     * (e.g., elements, comments, processing instructions, CDATA sections, and entity references)
     * separates <code>Text</code> nodes, i.e., there are neither adjacent <code>Text</code> nodes
     * nor empty <code>Text</code> nodes. This can be used to ensure that the DOM view of a document
     * is the same as if it were saved and re-loaded, and is useful when operations (such as
     * XPointer  lookups) that depend on a particular document tree structure are to be used.In
     * cases where the document contains <code>CDATASections</code>, the normalize operation alone
     * may not be sufficient, since XPointers do not differentiate between <code>Text</code> nodes
     * and <code>CDATASection</code> nodes.
     */
    public void normalize() {
        document.normalize();
    }

    /**
     * Tests whether the DOM implementation implements a specific feature and that feature is
     * supported by this node.
     *
     * @param feature The name of the feature to test. This is the same name which can be passed to
     *                the method <code>hasFeature</code> on <code>DOMImplementation</code>.
     * @param version This is the version number of the feature to test. In Level 2, version 1, this
     *                is the string "2.0". If the version is not specified, supporting any version
     *                of the feature will cause the method to return <code>true</code>.
     * @return Returns <code>true</code> if the specified feature is supported on this node,
     *         <code>false</code> otherwise.
     * @since DOM Level 2
     */
    public boolean isSupported(String feature, String version) {
        return document.isSupported(feature, version);
    }

    /**
     * The namespace URI of this node, or <code>null</code> if it is unspecified. <br>This is not a
     * computed value that is the result of a namespace lookup based on an examination of the
     * namespace declarations in scope. It is merely the namespace URI given at creation time.
     * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
     * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 method, such as
     * <code>createElement</code> from the <code>Document</code> interface, this is always
     * <code>null</code>.Per the Namespaces in XML Specification  an attribute does not inherit its
     * namespace from the element it is attached to. If an attribute is not explicitly given a
     * namespace, it simply has no namespace.
     *
     * @since DOM Level 2
     */
    public String getNamespaceURI() {
        return document.getNamespaceURI();
    }

    /**
     * The namespace prefix of this node, or <code>null</code> if it is unspecified. <br>Note that
     * setting this attribute, when permitted, changes the <code>nodeName</code> attribute, which
     * holds the qualified name, as well as the <code>tagName</code> and <code>name</code>
     * attributes of the <code>Element</code> and <code>Attr</code> interfaces, when applicable.
     * <br>Note also that changing the prefix of an attribute that is known to have a default value,
     * does not make a new attribute with the default value and the original prefix appear, since
     * the <code>namespaceURI</code> and <code>localName</code> do not change. <br>For nodes of any
     * type other than <code>ELEMENT_NODE</code> and <code>ATTRIBUTE_NODE</code> and nodes created
     * with a DOM Level 1 method, such as <code>createElement</code> from the <code>Document</code>
     * interface, this is always <code>null</code>.
     *
     * @throws DOMException INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
     *                      illegal character, per the XML 1.0 specification .
     *                      <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
     *                      <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is
     *                      malformed per the Namespaces in XML specification, if the
     *                      <code>namespaceURI</code> of this node is <code>null</code>, if the
     *                      specified prefix is "xml" and the <code>namespaceURI</code> of this node
     *                      is different from "http://www.w3.org/XML/1998/namespace", if this node
     *                      is an attribute and the specified prefix is "xmlns" and the
     *                      <code>namespaceURI</code> of this node is different from "
     *                      http://www.w3.org/2000/xmlns/", or if this node is an attribute and the
     *                      <code>qualifiedName</code> of this node is "xmlns" .
     * @since DOM Level 2
     */
    public String getPrefix() {
        return document.getPrefix();
    }

    /**
     * The namespace prefix of this node, or <code>null</code> if it is unspecified. <br>Note that
     * setting this attribute, when permitted, changes the <code>nodeName</code> attribute, which
     * holds the qualified name, as well as the <code>tagName</code> and <code>name</code>
     * attributes of the <code>Element</code> and <code>Attr</code> interfaces, when applicable.
     * <br>Note also that changing the prefix of an attribute that is known to have a default value,
     * does not make a new attribute with the default value and the original prefix appear, since
     * the <code>namespaceURI</code> and <code>localName</code> do not change. <br>For nodes of any
     * type other than <code>ELEMENT_NODE</code> and <code>ATTRIBUTE_NODE</code> and nodes created
     * with a DOM Level 1 method, such as <code>createElement</code> from the <code>Document</code>
     * interface, this is always <code>null</code>.
     *
     * @throws DOMException INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
     *                      illegal character, per the XML 1.0 specification .
     *                      <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
     *                      <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is
     *                      malformed per the Namespaces in XML specification, if the
     *                      <code>namespaceURI</code> of this node is <code>null</code>, if the
     *                      specified prefix is "xml" and the <code>namespaceURI</code> of this node
     *                      is different from "http://www.w3.org/XML/1998/namespace", if this node
     *                      is an attribute and the specified prefix is "xmlns" and the
     *                      <code>namespaceURI</code> of this node is different from "
     *                      http://www.w3.org/2000/xmlns/", or if this node is an attribute and the
     *                      <code>qualifiedName</code> of this node is "xmlns" .
     * @since DOM Level 2
     */
    public void setPrefix(String arg0) throws DOMException {
        document.setPrefix(arg0);
    }

    /**
     * Returns the local part of the qualified name of this node. <br>For nodes of any type other
     * than <code>ELEMENT_NODE</code> and <code>ATTRIBUTE_NODE</code> and nodes created with a DOM
     * Level 1 method, such as <code>createElement</code> from the <code>Document</code> interface,
     * this is always <code>null</code>.
     *
     * @since DOM Level 2
     */
    public String getLocalName() {
        return document.getLocalName();
    }

    /**
     * Returns whether this node (if it is an element) has any attributes.
     *
     * @return <code>true</code> if this node has any attributes, <code>false</code> otherwise.
     * @since DOM Level 2
     */
    public boolean hasAttributes() {
        return document.hasAttributes();
    }

    protected void setMessage(SOAPMessageImpl message) {
        soapMessage = message;
    }

    /*
     * DOM-Level 3 methods
     */

    public String getBaseURI() {
        return document.getBaseURI();
    }

    public short compareDocumentPosition(Node node) throws DOMException {
        return document.compareDocumentPosition(node);
    }

    public String getTextContent() throws DOMException {
        return document.getTextContent();
    }

    public void setTextContent(String textContent) throws DOMException {
        document.setTextContent(textContent);
    }

    public boolean isSameNode(Node other) {
        return document.isSameNode(other);
    }

    public String lookupPrefix(String namespaceURI) {
        return document.lookupPrefix(namespaceURI);
    }

    public boolean isDefaultNamespace(String namespaceURI) {
        return document.isDefaultNamespace(namespaceURI);
    }

    public String lookupNamespaceURI(String prefix) {
        return document.lookupNamespaceURI(prefix);
    }

    public boolean isEqualNode(Node node) {
        return document.isEqualNode(node);
    }

    public Object getFeature(String feature, String version) {
        return document.getFeature(feature, version);
    }

    public Object setUserData(String key, Object data, UserDataHandler handler) {
        return document.setUserData(key, data, handler);
    }

    public Object getUserData(String key) {
        return document.getUserData(key);
    }

    public String getValue() {
    	//There are no immediate child text nodes to soap part
        return null;        
    }        


    public void setParentElement(SOAPElement parent) throws SOAPException {
    	throw new SOAPException("Cannot set the parent element of SOAPPart");
    }

    public SOAPElement getParentElement() {
        return null;  //SOAP part is the root element
    }

    public void detachNode() {
        //nothing to do here
    }

    public void recycleNode() {
        //nothing to do here
    }

    public void setValue(String value) {
    	throw new IllegalStateException("Cannot set value of SOAPPart.");
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?