SAAJResult (Java EE 5)

Java EE API


javax.xml.soap Class SAAJResult

java.lang.Object
  extended by javax.xml.transform.dom.DOMResult
      extended by javax.xml.soap.SAAJResult
All Implemented Interfaces:
Result

public class SAAJResult
extends DOMResult

Extends: javax.xml.transform.dom.DOMResult

以 SAAJ 树的形式,充当 JAXP 转换或 JAXB 编组结果的持有者。这些结果应通过使用 #getResult() 方法访问。几乎在所有情况下,都应避免使用 getNode() 方法。
英文文档:

Acts as a holder for the results of a JAXP transformation or a JAXB marshalling, in the form of a SAAJ tree. These results should be accessed by using the getResult() method. The DOMResult.getNode() method should be avoided in almost all cases.

Since:
SAAJ 1.3
Author:
XWS-Security Development Team

Field Summary
 
Fields inherited from class javax.xml.transform.dom.DOMResult
 
Fields inherited from interface javax.xml.transform.Result
 
Constructor Summary
 
Method Summary
 Node
 
Methods inherited from class javax.xml.transform.dom.DOMResult
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public SAAJResult() throws SOAPException
创建一个 SAAJResult,此类将以支持默认 (SOAP 1.1) 协议的 SAAJ 树的形式显示结果。

这种 SAAJResult 用在结果将被用作方法参数的情况下,其中的方法指带有其类型(如 SOAPElement)取自 SAAJ API 的方法。当用于转换时,结果被填充到内部创建的 SOAPMessageSOAPPart 中。由 getNode() 返回的 SOAPPart 不能保证格式良好。

ThrowsSOAPException: 如果在创建 SOAPMessage 时出现问题
sinceSAAJ 1.3

英文文档:

SAAJResult

public SAAJResult()
           throws SOAPException
Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the default (SOAP 1.1) protocol.

This kind of SAAJResult is meant for use in situations where the results will be used as a parameter to a method that takes a parameter whose type, such as SOAPElement, is drawn from the SAAJ API. When used in a transformation, the results are populated into the SOAPPart of a SOAPMessage that is created internally. The SOAPPart returned by DOMResult.getNode() is not guaranteed to be well-formed.

Throws:
SOAPException - if there is a problem creating a SOAPMessage
Since:
SAAJ 1.3


public SAAJResult(String protocol) throws SOAPException
创建一个 SAAJResult,它将以支持指定协议的 SAAJ 树的形式显示结果。DYNAMIC_SOAP_PROTOCOL 在此上下文中不明确,并会导致此构造方法抛出 UnsupportedOperationException

这种 SAAJResult 用在结果将被用作方法参数的情况下,其中的方法指带有其类型(如 SOAPElement)取自 SAAJ API 的方法。当用于转换时,结果被填充到内部创建的 SOAPMessageSOAPPart 中。由 getNode() 返回的 SOAPPart 不能保证格式良好。

protocol 所得 SAAJ 树应支持的 SOAP 协议的名称
ThrowsSOAPException: 如果无法创建支持指定协议的 SOAPMessage
sinceSAAJ 1.3

英文文档:

SAAJResult

public SAAJResult(String protocol)
           throws SOAPException
Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the specified protocol. The DYNAMIC_SOAP_PROTOCOL is ambiguous in this context and will cause this constructor to throw an UnsupportedOperationException.

This kind of SAAJResult is meant for use in situations where the results will be used as a parameter to a method that takes a parameter whose type, such as SOAPElement, is drawn from the SAAJ API. When used in a transformation the results are populated into the SOAPPart of a SOAPMessage that is created internally. The SOAPPart returned by DOMResult.getNode() is not guaranteed to be well-formed.

Parameters:
protocol - - the name of the SOAP protocol that the resulting SAAJ tree should support
Throws:
SOAPException - if a SOAPMessage supporting the specified protocol cannot be created
Since:
SAAJ 1.3


public SAAJResult(SOAPMessage message)
创建一个 SAAJResult,它会将结果写入提供的 SOAPMessageSOAPPart 中。在正常情况下,将使用 DOM API 编写这些结果,因此,如果用来创建 SOAPPart 的数据不是格式良好的,则不保证完成的 SOAPPart 格式良好。当在转换中使用时,转换之后 SOAPMessage 的有效性只有通过 SAAJ 规范之外的方式才能得到保证。
message 消息,该消息的 SOAPPart 将会由于某些转换或编组操作而被填充
sinceSAAJ 1.3
英文文档:

SAAJResult

public SAAJResult(SOAPMessage message)
Creates a SAAJResult that will write the results into the SOAPPart of the supplied SOAPMessage. In the normal case these results will be written using DOM APIs and, as a result, the finished SOAPPart will not be guaranteed to be well-formed unless the data used to create it is also well formed. When used in a transformation the validity of the SOAPMessage after the transformation can be guaranteed only by means outside SAAJ specification.

Parameters:
message - - the message whose SOAPPart will be populated as a result of some transformation or marshalling operation
Since:
SAAJ 1.3


public SAAJResult(SOAPElement rootNode)
创建一个 SAAJResult,它会将结果编写为指定 SOAPElement 的子节点。在正常情况下,将使用 DOM API 编写这些结果,因此可能使 SAAJ 树结构无效。只有在传入数据的有效性可以通过 SAAJ 规范之外的方式得到保证的情况下,才使用这种 SAAJResult
rootNode 将追加结果的根节点
sinceSAAJ 1.3
英文文档:

SAAJResult

public SAAJResult(SOAPElement rootNode)
Creates a SAAJResult that will write the results as a child node of the SOAPElement specified. In the normal case these results will be written using DOM APIs and as a result may invalidate the structure of the SAAJ tree. This kind of SAAJResult should only be used when the validity of the incoming data can be guaranteed by means outside of the SAAJ specification.

Parameters:
rootNode - - the root to which the results will be appended
Since:
SAAJ 1.3

Method Detail

public Node getResult()
return 在指定根 Node 下创建的结果 Tree。
sinceSAAJ 1.3
英文文档:

getResult

public Node getResult()
Returns:
the resulting Tree that was created under the specified root Node.
Since:
SAAJ 1.3


Submit a bug or feature

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

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

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