soapelement.html
来自「j2ee api,很好的api。我这现在有」· HTML 代码 · 共 950 行 · 第 1/4 页
HTML
950 行
<DT><B>Parameters:</B><DD><CODE>localName</CODE> - a <code>String</code> giving the local name for the new element<DD><CODE>prefix</CODE> - a <code>String</code> giving the namespace prefix for the new element<DD><CODE>uri</CODE> - a <code>String</code> giving the URI of the namespace to which the new element belongs<DT><B>Returns:</B><DD>the new <code>SOAPElement</code> object that was created<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></CODE> - if there is an error in creating the <code>SOAPElement</code> object</DL></DD></DL><HR><A NAME="addChildElement(javax.xml.soap.SOAPElement)"><!-- --></A><H3>addChildElement</H3><PRE>public <A HREF="../../../javax/xml/soap/SOAPElement.html" title="interface in javax.xml.soap">SOAPElement</A> <B>addChildElement</B>(<A HREF="../../../javax/xml/soap/SOAPElement.html" title="interface in javax.xml.soap">SOAPElement</A> element) throws <A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></PRE><DL><DD>Add a <code>SOAPElement</code> as a child of this <code>SOAPElement</code> instance. The <code>SOAPElement</code> is expected to be created by a <code>SOAPElementFactory</code>. Callers should not rely on the element instance being added as is into the XML tree. Implementations could end up copying the content of the <code>SOAPElement</code> passed into an instance of a different <code>SOAPElement</code> implementation. For instance if <code>addChildElement()</code> is called on a <code>SOAPHeader</code>, <code>element</code> will be copied into an instance of a <code>SOAPHeaderElement</code>. <P>The fragment rooted in <code>element</code> is either added as a whole or not at all, if there was an error. <P>The fragment rooted in <code>element</code> cannot contain elements named "Envelope", "Header" or "Body" and in the SOAP namespace. Any namespace prefixes present in the fragment should be fully resolved using appropriate namespace declarations within the fragment itself.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>element</CODE> - the <code>SOAPElement</code> to be added as a new child<DT><B>Returns:</B><DD>an instance representing the new SOAP element that was actually added to the tree.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></CODE> - if there was an error in adding this element as a child</DL></DD></DL><HR><A NAME="removeContents()"><!-- --></A><H3>removeContents</H3><PRE>public void <B>removeContents</B>()</PRE><DL><DD>Detaches all children of this <code>SOAPElement</code>. <p> This method is useful for rolling back the construction of partially completed <code>SOAPHeaders</code> and <code>SOAPBodys</code> in preparation for sending a fault when an error condition is detected. It is also useful for recycling portions of a document within a SOAP message.<P><DD><DL></DL></DD><DD><DL><DT><B>Since:</B></DT> <DD>SAAJ 1.2</DD></DL></DD></DL><HR><A NAME="addTextNode(java.lang.String)"><!-- --></A><H3>addTextNode</H3><PRE>public <A HREF="../../../javax/xml/soap/SOAPElement.html" title="interface in javax.xml.soap">SOAPElement</A> <B>addTextNode</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> text) throws <A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></PRE><DL><DD>Creates a new <code>Text</code> object initialized with the given <code>String</code> and adds it to this <code>SOAPElement</code> object.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>text</CODE> - a <code>String</code> object with the textual content to be added<DT><B>Returns:</B><DD>the <code>SOAPElement</code> object into which the new <code>Text</code> object was inserted<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></CODE> - if there is an error in creating the new <code>Text</code> object</DL></DD></DL><HR><A NAME="addAttribute(javax.xml.soap.Name, java.lang.String)"><!-- --></A><H3>addAttribute</H3><PRE>public <A HREF="../../../javax/xml/soap/SOAPElement.html" title="interface in javax.xml.soap">SOAPElement</A> <B>addAttribute</B>(<A HREF="../../../javax/xml/soap/Name.html" title="interface in javax.xml.soap">Name</A> name, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> value) throws <A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></PRE><DL><DD>Adds an attribute with the specified name and value to this <code>SOAPElement</code> object.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - a <code>Name</code> object with the name of the attribute<DD><CODE>value</CODE> - a <code>String</code> giving the value of the attribute<DT><B>Returns:</B><DD>the <code>SOAPElement</code> object into which the attribute was inserted<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></CODE> - if there is an error in creating the Attribute</DL></DD></DL><HR><A NAME="addNamespaceDeclaration(java.lang.String, java.lang.String)"><!-- --></A><H3>addNamespaceDeclaration</H3><PRE>public <A HREF="../../../javax/xml/soap/SOAPElement.html" title="interface in javax.xml.soap">SOAPElement</A> <B>addNamespaceDeclaration</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> prefix, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> uri) throws <A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></PRE><DL><DD>Adds a namespace declaration with the specified prefix and URI to this <code>SOAPElement</code> object.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>prefix</CODE> - a <code>String</code> giving the prefix of the namespace<DD><CODE>uri</CODE> - a <code>String</code> giving the uri of the namespace<DT><B>Returns:</B><DD>the <code>SOAPElement</code> object into which this namespace declaration was inserted.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></CODE> - if there is an error in creating the namespace</DL></DD></DL><HR><A NAME="getAttributeValue(javax.xml.soap.Name)"><!-- --></A><H3>getAttributeValue</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getAttributeValue</B>(<A HREF="../../../javax/xml/soap/Name.html" title="interface in javax.xml.soap">Name</A> name)</PRE><DL><DD>Returns the value of the attribute with the specified name.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - a <code>Name</code> object with the name of the attribute<DT><B>Returns:</B><DD>a <code>String</code> giving the value of the specified attribute</DL></DD></DL><HR><A NAME="getAllAttributes()"><!-- --></A><H3>getAllAttributes</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A> <B>getAllAttributes</B>()</PRE><DL><DD>Returns an <code>Iterator</code> over all of the attribute <code>Name</code> objects in this <code>SOAPElement</code> object. The iterator can be used to get the attribute names, which can then be passed to the method <code>getAttributeValue</code> to retrieve the value of each attribute.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an iterator over the names of the attributes</DL></DD></DL><HR><A NAME="getNamespaceURI(java.lang.String)"><!-- --></A><H3>getNamespaceURI</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getNamespaceURI</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> prefix)</PRE><DL><DD>Returns the URI of the namespace that has the given prefix.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>prefix</CODE> - a <code>String</code> giving the prefix of the namespace for which to search<DT><B>Returns:</B><DD>a <code>String</code> with the uri of the namespace that has the given prefix</DL></DD></DL><HR><A NAME="getNamespacePrefixes()"><!-- --></A><H3>getNamespacePrefixes</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A> <B>getNamespacePrefixes</B>()</PRE><DL><DD>Returns an <code>Iterator</code> over the namespace prefix <code>String</code>s declared by this element. The prefixes returned by this iterator can be passed to the method <code>getNamespaceURI</code> to retrieve the URI of each namespace.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an iterator over the namespace prefixes in this <code>SOAPElement</code> object</DL></DD></DL><HR><A NAME="getVisibleNamespacePrefixes()"><!-- --></A><H3>getVisibleNamespacePrefixes</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A> <B>getVisibleNamespacePrefixes</B>()</PRE><DL><DD>Returns an <code>Iterator</code> over the namespace prefix <code>String</code>s visible to this element. The prefixes returned by this iterator can be passed to the method <code>getNamespaceURI</code> to retrieve the URI of each namespace.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?