SOAPElement (Java EE 5)

Java EE API


javax.xml.soap Interface SOAPElement

All Superinterfaces:
Element, Node
All Known Subinterfaces:
Detail, DetailEntry, SOAPBody, SOAPBodyElement, SOAPEnvelope, SOAPFault, SOAPFaultElement, SOAPHeader, SOAPHeaderElement

public interface SOAPElement
extends Node, Element

Implements: Node, org.w3c.dom.Element

表示 SOAP 规范允许使用但未特别规定的 SOAP 消息元素的对象。此接口充当 SOAP 规范特别规定的那些对象的基本接口。

此接口中要求返回特定于 SAAJ 的对象的那些方法可以“安静地”替换树中的节点,以便按要求成功返回正确类型的对象。有关详细信息,请参见 #getChildElements()HREF="package-summary.html#package_description">javax.xml.soap

英文文档:

An object representing an element of a SOAP message that is allowed but not specifically prescribed by a SOAP specification. This interface serves as the base interface for those objects that are specifically prescribed by a SOAP specification.

Methods in this interface that are required to return SAAJ specific objects may "silently" replace nodes in the tree as required to successfully return objects of the correct type. See getChildElements() and javax.xml.soap for details.


Field Summary
 
Fields inherited from interface org.w3c.dom.Node
 
Fields inherited from interface org.w3c.dom.Node
 
Method Summary
 SOAPElement
 SOAPElement
 SOAPElement
 SOAPElement
 SOAPElement
 SOAPElement
 SOAPElement
 SOAPElement
 SOAPElement
 SOAPElement
 QName
 Iterator
 Iterator
 String
 String
 Iterator
 Iterator
 Iterator
 Name
 QName
 String
 Iterator
 String
 Iterator
 boolean
 boolean
 void
 boolean
 SOAPElement
 void
 
Methods inherited from interface javax.xml.soap.Node
 
Methods inherited from interface org.w3c.dom.Node
 
Methods inherited from interface org.w3c.dom.Element
 
Methods inherited from interface org.w3c.dom.Node
 

Method Detail

public SOAPElement addChildElement(Name name) throws SOAPException
创建使用给定 Name 对象初始化的新 SOAPElement 对象,并将该新元素添加到此 SOAPElement 对象。

此方法在以后的 SAAJ 版本中可能会被废弃,并用 addChildElement(javax.xml.namespace.QName) 取代。

name Name 对象,带有新元素的 XML 名称
return 创建的新 SOAPElement 对象
ThrowsSOAPException: 如果在创建 SOAPElement 对象时发生错误
See also addChildElement(javax.xml.namespace.QName)

英文文档:

addChildElement

SOAPElement addChildElement(Name name)
                            throws SOAPException
Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.

This method may be deprecated in a future release of SAAJ in favor of addChildElement(javax.xml.namespace.QName)

Parameters:
name - a Name object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object
See Also:
addChildElement(javax.xml.namespace.QName)

public SOAPElement addChildElement(javax.xml.namespace.QName qname) throws SOAPException
创建使用给定 QName 对象初始化的新 SOAPElement 对象,并将该新元素添加到此 SOAPElement 对象。新 SOAPElementnamespacelocalnameprefix 都取自 qname 参数。
qname QName 对象,带有新元素的 XML 名称
return 创建的新 SOAPElement 对象
ThrowsSOAPException: 如果在创建 SOAPElement 对象时发生错误
sinceSAAJ 1.3
See also addChildElement(Name)
英文文档:

addChildElement

SOAPElement addChildElement(QName qname)
                            throws SOAPException
Creates a new SOAPElement object initialized with the given QName object and adds the new element to this SOAPElement object. The namespace, localname and prefix of the new SOAPElement are all taken from the qname argument.

Parameters:
qname - a QName object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object
Since:
SAAJ 1.3
See Also:
addChildElement(Name)

public SOAPElement addChildElement(String localName) throws SOAPException
创建使用指定本地名称初始化的新 SOAPElement 对象,并将该新元素添加到此 SOAPElement 对象。新的 SOAPElement 继承任何作用域内的默认名称空间。
localName 给出元素本地名称的 String
return 创建的新 SOAPElement 对象
ThrowsSOAPException: 如果在创建 SOAPElement 对象时发生错误
英文文档:

addChildElement

SOAPElement addChildElement(String localName)
                            throws SOAPException
Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object. The new SOAPElement inherits any in-scope default namespace.

Parameters:
localName - a String giving the local name for the element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

public SOAPElement addChildElement(String localName, String prefix) throws SOAPException
创建使用指定本地名称和前缀初始化的新 SOAPElement 对象,并将该新元素添加到此 SOAPElement 对象。
localName 给出新元素本地名称的 String
prefix 给出新元素名称空间前缀的 String
return 创建的新 SOAPElement 对象
ThrowsSOAPException: 如果 prefix 在此 SOAPElement 上下文中无效,或者在创建 SOAPElement 对象时发生错误
英文文档:

addChildElement

SOAPElement addChildElement(String localName,
                            String prefix)
                            throws SOAPException
Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.

Parameters:
localName - a String giving the local name for the new element
prefix - a String giving the namespace prefix for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if the prefix is not valid in the context of this SOAPElement or if there is an error in creating the SOAPElement object

public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException
创建使用指定本地名称、前缀和 URI 初始化的新 SOAPElement 对象,并将该新元素添加到此 SOAPElement 对象。
localName 给出新元素本地名称的 String
prefix 给出新元素名称空间前缀的 String
uri 给出新元素所属空间名称 URI 的 String
return 创建的新 SOAPElement 对象
ThrowsSOAPException: 如果在创建 SOAPElement 对象时发生错误
英文文档:

addChildElement

SOAPElement addChildElement(String localName,
                            String prefix,
                            String uri)
                            throws SOAPException
Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.

Parameters:
localName - a String giving the local name for the new element
prefix - a String giving the namespace prefix for the new element
uri - a String giving the URI of the namespace to which the new element belongs
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

public SOAPElement addChildElement(SOAPElement element) throws SOAPException
SOAPElement 作为此 SOAPElement 实例的子级添加。应该由 SOAPFactory 来创建 SOAPElement。调用者不应依靠此方式添加到 XML 树的元素实例。实现最后可以将传递的 SOAPElement 的内容复制到一个不同 SOAPElement 实现的实例中。例如,如果对 SOAPHeader 调用 addChildElement(),则 element 将被复制到 SOAPHeaderElement 的实例中。

element 为根的片段将作为一个整体添加,如果发生错误,则不添加。

element 为根的片段不能包含名为 "Envelope"、"Header" 或 "Body" 且属于 SOAP 名称空间的元素。片段中出现的任何名称空间前缀都应该使用片段本身中适当的名称空间声明来完整解析。

element 要作为新子级添加的 SOAPElement
ThrowsSOAPException: 如果在作为子级添加此元素时出现错误
return 一个实例,表示实际添加到树的新 SOAP 元素。

英文文档:

addChildElement

SOAPElement addChildElement(SOAPElement element)
                            throws SOAPException
Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is expected to be created by a SOAPFactory. 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 SOAPElement passed into an instance of a different SOAPElement implementation. For instance if addChildElement() is called on a SOAPHeader, element will be copied into an instance of a SOAPHeaderElement.

The fragment rooted in element is either added as a whole or not at all, if there was an error.

The fragment rooted in element 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.

Parameters:
element - the SOAPElement to be added as a new child
Returns:
an instance representing the new SOAP element that was actually added to the tree.
Throws:
SOAPException - if there was an error in adding this element as a child

public void removeContents()
分离此 SOAPElement 的所有子级。

此方法对回滚部分完成的 SOAPHeadersSOAPBodys 的构造很有用,便于准备在检测到错误条件时发送错误。它对于回收 SOAP 消息中的文档各部分也很有用。

sinceSAAJ 1.2

英文文档:

removeContents

void removeContents()
Detaches all children of this SOAPElement.

This method is useful for rolling back the construction of partially completed SOAPHeaders and SOAPBodys 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.

Since:
SAAJ 1.2

public SOAPElement addTextNode(String text) throws SOAPException
创建使用给定 String 初始化的新 Text 对象,并将其添加到此 SOAPElement 对象。
text 带有要添加文本内容的 String 对象
return 将插入新 Text 对象的 SOAPElement 对象
ThrowsSOAPException: 如果在创建新 Text 时发生错误,或者将它作为子级附加到此 SOAPElement 不合法
英文文档:

addTextNode

SOAPElement addTextNode(String text)
                        throws SOAPException
Creates a new Text object initialized with the given String and adds it to this SOAPElement object.

Parameters:
text - a String object with the textual content to be added
Returns:
the SOAPElement object into which the new Text object was inserted
Throws:
SOAPException - if there is an error in creating the new Text object or if it is not legal to attach it as a child to this SOAPElement

public SOAPElement addAttribute(Name name, String value) throws SOAPException
将带有指定名称和值的属性添加到此 SOAPElement 对象。
name 带有属性名称的 Name 对象
value 给出属性值的 String
return 将插入属性的 SOAPElement 对象
ThrowsSOAPException: 如果在创建属性时发生错误,或者在此 SOAPElement 上设置带有 Name name 的属性无效。
See also addAttribute(javax.xml.namespace.QName, String)
英文文档:

addAttribute

SOAPElement addAttribute(Name name,
                         String value)
                         throws SOAPException
Adds an attribute with the specified name and value to this SOAPElement object.

Parameters:
name - a Name object with the name of the attribute
value - a String giving the value of the attribute
Returns:
the SOAPElement object into which the attribute was inserted
Throws:
SOAPException - if there is an error in creating the Attribute, or it is invalid to set an attribute with Name name on this SOAPElement.
See Also:
addAttribute(javax.xml.namespace.QName, String)

public SOAPElement addAttribute(javax.xml.namespace.QName qname, String value) throws SOAPException
将带有指定名称和值的属性添加到此 SOAPElement 对象。
qname 带有属性名称的 QName 对象
value 给出属性值的 String
return 将插入属性的 SOAPElement 对象
ThrowsSOAPException: 如果在创建属性时出现错误,如果在此 SOAPElement 上设置带有 QName qname 的属性无效。
sinceSAAJ 1.3
See also addAttribute(Name, String)
英文文档:

addAttribute

SOAPElement addAttribute(QName qname,
                         String value)
                         throws SOAPException
Adds an attribute with the specified name and value to this SOAPElement object.

Parameters:
qname - a QName object with the name of the attribute
value - a String giving the value of the attribute
Returns:
the SOAPElement object into which the attribute was inserted
Throws:
SOAPException - if there is an error in creating the Attribute, or it is invalid to set an attribute with QName qname on this SOAPElement.
Since:
SAAJ 1.3
See Also:
addAttribute(Name, String)

public SOAPElement addNamespaceDeclaration(String prefix, String uri) throws SOAPException
将带有指定前缀和 URI 的名称空间声明添加到此 SOAPElement 对象。
prefix 给出名称空间前缀的 String
uri 给出名称空间 URI 的 String
return 将插入名称空间声明的 SOAPElement 对象。
ThrowsSOAPException: 如果在创建名称空间时发生错误
英文文档:

addNamespaceDeclaration

SOAPElement addNamespaceDeclaration(String prefix,
                                    String uri)
                                    throws SOAPException
Adds a namespace declaration with the specified prefix and URI to this SOAPElement object.

Parameters:
prefix - a String giving the prefix of the namespace
uri - a String giving the uri of the namespace
Returns:
the SOAPElement object into which this namespace declaration was inserted.
Throws:
SOAPException - if there is an error in creating the namespace

public String getAttributeValue(Name name)
返回带有指定名称的属性值。
name 带有属性名称的 Name 对象
return 给出指定属性值的 String,如果没有这种属性,则返回 Null
See also getAttributeValue(javax.xml.namespace.QName)
英文文档:

getAttributeValue

String getAttributeValue(Name name)
Returns the value of the attribute with the specified name.

Parameters:
name - a Name object with the name of the attribute
Returns:
a String giving the value of the specified attribute, Null if there is no such attribute
See Also:
getAttributeValue(javax.xml.namespace.QName)

public String getAttributeValue(javax.xml.namespace.QName qname)
返回带有指定 qname 的属性值。
qname 带有属性 qname 的 QName 对象
return 给出指定属性值的 String,如果没有这种属性,则返回 Null
sinceSAAJ 1.3
See also getAttributeValue(Name)
英文文档:

getAttributeValue

String getAttributeValue(QName qname)
Returns the value of the attribute with the specified qname.

Parameters:
qname - a QName object with the qname of the attribute
Returns:
a String giving the value of the specified attribute, Null if there is no such attribute
Since:
SAAJ 1.3
See Also:
getAttributeValue(Name)

public java.util.Iterator<E> getAllAttributes()
返回可在此 SOAPElement 对象中所有属性 Name 对象上进行迭代的 Iterator。迭代器可以用于获取属性名称,然后可将这些名称传递给方法 getAttributeValue 以检索每个属性的值。
return 在属性名称上进行迭代的迭代器
See also getAllAttributesAsQNames()
英文文档:

getAllAttributes

Iterator getAllAttributes()
Returns an Iterator over all of the attribute Name objects in this SOAPElement object. The iterator can be used to get the attribute names, which can then be passed to the method getAttributeValue to retrieve the value of each attribute.

Returns:
an iterator over the names of the attributes
See Also:
getAllAttributesAsQNames()

public java.util.Iterator<E> getAllAttributesAsQNames()
返回可在此 SOAPElement 对象(以 QName 对象的形式)中的所有属性上进行迭代的 Iterator。迭代器可以用于获取属性 QName,然后可将这些名称传递给方法 getAttributeValue 以检索每个属性的值。
return 在属性的 QNames 上进行迭代的迭代器
sinceSAAJ 1.3
See also getAllAttributes()
英文文档:

getAllAttributesAsQNames

Iterator getAllAttributesAsQNames()
Returns an Iterator over all of the attributes in this SOAPElement as QName objects. The iterator can be used to get the attribute QName, which can then be passed to the method getAttributeValue to retrieve the value of each attribute.

Returns:
an iterator over the QNames of the attributes
Since:
SAAJ 1.3
See Also:
getAllAttributes()

public String getNamespaceURI(String prefix)
返回带有给定前缀的名称空间的 URI。
prefix 一个 String,给出用来搜索的名称空间前缀
return 一个 String,带有给定前缀名称空间的 URI
英文文档:

getNamespaceURI

String getNamespaceURI(String prefix)
Returns the URI of the namespace that has the given prefix.

Parameters:
prefix - a String giving the prefix of the namespace for which to search
Returns:
a String with the uri of the namespace that has the given prefix

public java.util.Iterator<E> getNamespacePrefixes()
返回可在此元素声明的名称空间前缀 String 上进行迭代的 Iterator。由此迭代器返回的前缀可以传递给方法 getNamespaceURI,以检索每个名称空间的 URI。
return 在此 SOAPElement 对象的名称空间前缀上进行迭代的迭代器
英文文档:

getNamespacePrefixes

Iterator getNamespacePrefixes()
Returns an Iterator over the namespace prefix Strings declared by this element. The prefixes returned by this iterator can be passed to the method getNamespaceURI to retrieve the URI of each namespace.

Returns:
an iterator over the namespace prefixes in this SOAPElement object

public java.util.Iterator<E> getVisibleNamespacePrefixes()
返回在此元素可见的名称空间前缀 String 上进行迭代的 Iterator。由此迭代器返回的前缀可以传递给方法 getNamespaceURI,以检索每个名称空间的 URI。
return 在此 SOAPElement 对象作用域内的名称空间前缀上进行迭代的迭代器
sinceSAAJ 1.2
英文文档:

getVisibleNamespacePrefixes

Iterator getVisibleNamespacePrefixes()
Returns an Iterator over the namespace prefix Strings visible to this element. The prefixes returned by this iterator can be passed to the method getNamespaceURI to retrieve the URI of each namespace.

Returns:
an iterator over the namespace prefixes are within scope of this SOAPElement object
Since:
SAAJ 1.2

public javax.xml.namespace.QName createQName(String localName, String prefix) throws SOAPException
创建一个 QName,其名称空间 URI 应与此 SOAPElement 上下文中的参数、prefix 相关联。新 QName 的其余元素都直接取自参数、localNameprefix
localName 包含名称本地部分的 String
prefix 包含名称前缀的 String
return 一个 QName,带有指定的 localNameprefix,以及与此 SOAPElement 上下文中的 prefix 关联的名称空间。如果将 prefix 作为参数提供给 #getNamespaceURI(String),则此名称空间将与该方法返回的名称空间相同。
ThrowsSOAPException: 如果无法创建 QName
sinceSAAJ 1.3
英文文档:

createQName

QName createQName(String localName,
                  String prefix)
                  throws SOAPException
Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement. The remaining elements of the new QName are taken directly from the parameters, localName and prefix.

Parameters:
localName - a String containing the local part of the name.
prefix - a String containing the prefix for the name.
Returns:
a QName with the specified localName and prefix, and with a namespace that is associated with the prefix in the context of this SOAPElement. This namespace will be the same as the one that would be returned by getNamespaceURI(String) if it were given prefix as it's parameter.
Throws:
SOAPException - if the QName cannot be created.
Since:
SAAJ 1.3

public Name getElementName()
返回此 SOAPElement 对象的名称。
return 具有此 SOAPElement 对象名称的 Name 对象
英文文档:

getElementName

Name getElementName()
Returns the name of this SOAPElement object.

Returns:
a Name object with the name of this SOAPElement object

public javax.xml.namespace.QName getElementQName()
返回此 SOAPElement 对象的 qname。
return 具有此 SOAPElement 对象 qname 的 QName 对象
sinceSAAJ 1.3
See also getElementName()
英文文档:

getElementQName

QName getElementQName()
Returns the qname of this SOAPElement object.

Returns:
a QName object with the qname of this SOAPElement object
Since:
SAAJ 1.3
See Also:
getElementName()

public SOAPElement setElementQName(javax.xml.namespace.QName newName) throws SOAPException
如果可能,将此 Element 的名称更改为 newName。SOAP 定义的元素,如 SOAPEnvelope、SOAPHeader、SOAPBody 等,都无法使用此方法更改它们的名称。任何此类尝试都会导致抛出 SOAPException。

调用者不应依靠按此方式重命名的元素实例。实现最后可以将 SOAPElement 的内容复制到重命名实例。

newName Element 的新名称。
ThrowsSOAPException: 如果不允许更改此 Element 的名称。
return 重命名的节点
sinceSAAJ 1.3

英文文档:

setElementQName

SOAPElement setElementQName(QName newName)
                            throws SOAPException
Changes the name of this Element to newName if possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody etc. cannot have their names changed using this method. Any attempt to do so will result in a SOAPException being thrown.

Callers should not rely on the element instance being renamed as is. Implementations could end up copying the content of the SOAPElement to a renamed instance.

Parameters:
newName - the new name for the Element.
Returns:
The renamed Node
Throws:
SOAPException - if changing the name of this Element is not allowed.
Since:
SAAJ 1.3

public boolean removeAttribute(Name name)
移除带有指定名称的属性。
name Name 对象,带有要移除属性的名称
return 如果成功移除了属性,则返回 true;否则返回 false
See also removeAttribute(javax.xml.namespace.QName)
英文文档:

removeAttribute

boolean removeAttribute(Name name)
Removes the attribute with the specified name.

Parameters:
name - the Name object with the name of the attribute to be removed
Returns:
true if the attribute was removed successfully; false if it was not
See Also:
removeAttribute(javax.xml.namespace.QName)

public boolean removeAttribute(javax.xml.namespace.QName qname)
移除带有指定 qname 的属性。
qname QName 对象,带有要移除属性的 qname
return 如果成功移除了属性,则返回 true;否则返回 false
sinceSAAJ 1.3
See also removeAttribute(Name)
英文文档:

removeAttribute

boolean removeAttribute(QName qname)
Removes the attribute with the specified qname.

Parameters:
qname - the QName object with the qname of the attribute to be removed
Returns:
true if the attribute was removed successfully; false if it was not
Since:
SAAJ 1.3
See Also:
removeAttribute(Name)

public boolean removeNamespaceDeclaration(String prefix)
移除对应于给定前缀的名称空间声明。
prefix 一个 String,给出用来搜索的前缀
return 如果成功移除了名称空间声明,则返回 true;否则返回 false
英文文档:

removeNamespaceDeclaration

boolean removeNamespaceDeclaration(String prefix)
Removes the namespace declaration corresponding to the given prefix.

Parameters:
prefix - a String giving the prefix for which to search
Returns:
true if the namespace declaration was removed successfully; false if it was not

public java.util.Iterator<E> getChildElements()
返回可在此元素的所有直接子 Node 上进行迭代的 Iterator。这包括 javax.xml.soap.Text 对象以及 SOAPElement 对象。

调用此方法可能导致子 ElementSOAPElementorg.w3c.dom.Text 节点被适合于此父节点类型的 SOAPElementSOAPHeaderElementSOAPBodyElementjavax.xml.soap.Text 节点替换。因此,调用的应用程序必须将任何现有的对通过 DOM API 获取的那些子节点的引用视为无效,并将其丢弃或用此 Iterator 返回的值进行更新。可以通过调用等效的 DOM API 来避免此行为。有关更多信息,请参阅 HREF="package-summary.html#package_description">javax.xml.soap

return 带有此 SOAPElement 对象内容的迭代器

英文文档:

getChildElements

Iterator getChildElements()
Returns an Iterator over all the immediate child Nodes of this element. This includes javax.xml.soap.Text objects as well as SOAPElement objects.

Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes to be replaced by SOAPElement, SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for the type of this parent node. As a result the calling application must treat any existing references to these child nodes that have been obtained through DOM APIs as invalid and either discard them or refresh them with the values returned by this Iterator. This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details.

Returns:
an iterator with the content of this SOAPElement object

public java.util.Iterator<E> getChildElements(Name name)
返回可在带有指定名称的此元素所有直接子 Node 上进行迭代的 Iterator。所有这些子节点都将是 SOAPElement 节点。

调用此方法可能导致子 ElementSOAPElementorg.w3c.dom.Text 节点被适合于此父节点类型的 SOAPElementSOAPHeaderElementSOAPBodyElementjavax.xml.soap.Text 节点替换。因此,调用的应用程序必须将任何现有的对通过 DOM API 获取的那些子节点的引用视为无效,并将其丢弃或用此 Iterator 返回的值进行更新。可以通过调用等效的 DOM API 来避免此行为。有关更多信息,请参阅 HREF="package-summary.html#package_description">javax.xml.soap

name Name 对象,带有要返回的子元素的名称
return 在带有指定名称的此 SOAPElement 对象的所有元素上进行迭代的 Iterator 对象
See also getChildElements(javax.xml.namespace.QName)

英文文档:

getChildElements

Iterator getChildElements(Name name)
Returns an Iterator over all the immediate child Nodes of this element with the specified name. All of these children will be SOAPElement nodes.

Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes to be replaced by SOAPElement, SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for the type of this parent node. As a result the calling application must treat any existing references to these child nodes that have been obtained through DOM APIs as invalid and either discard them or refresh them with the values returned by this Iterator. This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details.

Parameters:
name - a Name object with the name of the child elements to be returned
Returns:
an Iterator object over all the elements in this SOAPElement object with the specified name
See Also:
getChildElements(javax.xml.namespace.QName)

public java.util.Iterator<E> getChildElements(javax.xml.namespace.QName qname)
返回可在带有指定 qname 的此元素所有直接子 Node 上进行迭代的 Iterator。所有这些子节点都将是 SOAPElement 节点。

调用此方法可能导致子 ElementSOAPElementorg.w3c.dom.Text 节点被适合于此父节点类型的 SOAPElementSOAPHeaderElementSOAPBodyElementjavax.xml.soap.Text 节点替换。因此,调用的应用程序必须将任何现有的对通过 DOM API 获取的那些子节点的引用视为无效,并将其丢弃或用此 Iterator 返回的值进行更新。可以通过调用等效的 DOM API 来避免此行为。有关更多信息,请参阅 HREF="package-summary.html#package_description">javax.xml.soap

qname QName 对象,带有要返回的子元素的 qname
return 在带有指定 qname 的此 SOAPElement 对象的所有元素上进行迭代的 Iterator 对象
sinceSAAJ 1.3
See also getChildElements(Name)

英文文档:

getChildElements

Iterator getChildElements(QName qname)
Returns an Iterator over all the immediate child Nodes of this element with the specified qname. All of these children will be SOAPElement nodes.

Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes to be replaced by SOAPElement, SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for the type of this parent node. As a result the calling application must treat any existing references to these child nodes that have been obtained through DOM APIs as invalid and either discard them or refresh them with the values returned by this Iterator. This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details.

Parameters:
qname - a QName object with the qname of the child elements to be returned
Returns:
an Iterator object over all the elements in this SOAPElement object with the specified qname
Since:
SAAJ 1.3
See Also:
getChildElements(Name)

public void setEncodingStyle(String encodingStyle) throws SOAPException
将此 SOAPElement 对象的编码样式设置为指定样式。
encodingStyle 给出编码样式的 String
ThrowsIllegalArgumentException: 如果在设置编码样式时出现问题。
ThrowsSOAPException: 如果为此 SOAPElement 设置的编码样式无效。
See also getEncodingStyle
英文文档:

setEncodingStyle

void setEncodingStyle(String encodingStyle)
                      throws SOAPException
Sets the encoding style for this SOAPElement object to one specified.

Parameters:
encodingStyle - a String giving the encoding style
Throws:
IllegalArgumentException - if there was a problem in the encoding style being set.
SOAPException - if setting the encodingStyle is invalid for this SOAPElement.
See Also:
getEncodingStyle()

public String getEncodingStyle()
返回此 SOAPElement 对象的编码样式。
return 给出编码样式的 String
See also setEncodingStyle
英文文档:

getEncodingStyle

String getEncodingStyle()
Returns the encoding style for this SOAPElement object.

Returns:
a String giving the encoding style
See Also:
setEncodingStyle(java.lang.String)


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!