Detail (Java EE 5)

Java EE API


javax.xml.soap Interface Detail

All Superinterfaces:
Element, Node, SOAPElement, SOAPFaultElement

public interface Detail
extends SOAPFaultElement

Implements: SOAPFaultElement

DetailEntry 对象的容器。DetailEntry 对象给出特定于应用程序的详细错误信息,以及与包含该对象的 SOAPBody 对象相关的详细错误信息。

可以使用方法 SOAPFault.getDetail 来检索 Detail 对象(SOAPFault 对象的一部分)。该 Detail 接口提供两个方法。第一种方法创建一个新 DetailEntry 对象,且自动将其添加到 Detail 对象。第二种方法获取 Detail 对象中包含的 DetailEntry 对象列表。

以下代码片段(其中 sfSOAPFault 对象)获取它的 Detail 对象 (d),将新的 DetailEntry 对象添加到 d,然后获取 d 中所有 DetailEntry 对象列表。该代码片段还创建要传递给方法 addDetailEntryName 对象。变量 se(用于创建 Name 对象)是一个 SOAPEnvelope 对象。

Detail d = sf.getDetail();
Name name = se.createName("GetLastTradePrice", "WOMBAT",
"http://www.wombat.org/trader");
d.addDetailEntry(name);
Iterator it = d.getDetailEntries();
 
英文文档:

A container for DetailEntry objects. DetailEntry objects give detailed error information that is application-specific and related to the SOAPBody object that contains it.

A Detail object, which is part of a SOAPFault object, can be retrieved using the method SOAPFault.getDetail. The Detail interface provides two methods. One creates a new DetailEntry object and also automatically adds it to the Detail object. The second method gets a list of the DetailEntry objects contained in a Detail object.

The following code fragment, in which sf is a SOAPFault object, gets its Detail object (d), adds a new DetailEntry object to d, and then gets a list of all the DetailEntry objects in d. The code also creates a Name object to pass to the method addDetailEntry. The variable se, used to create the Name object, is a SOAPEnvelope object.

    Detail d = sf.getDetail();
    Name name = se.createName("GetLastTradePrice", "WOMBAT",
                                "http://www.wombat.org/trader");
    d.addDetailEntry(name);
    Iterator it = d.getDetailEntries();
 


Field Summary
 
Fields inherited from interface org.w3c.dom.Node
 
Fields inherited from interface org.w3c.dom.Node
 
Method Summary
 DetailEntry
 DetailEntry
 Iterator
 
Methods inherited from interface javax.xml.soap.SOAPElement
 
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 DetailEntry addDetailEntry(Name name) throws SOAPException
使用给定名称创建新的 DetailEntry 对象,并将其添加到此 Detail 对象。
name 标识新 DetailEntry 对象的 Name 对象
ThrowsSOAPException: 当将 DetailEntry 对象添加到此 Detail 对象过程中存在问题时,抛出该异常。
See also addDetailEntry(QName qname)
英文文档:

addDetailEntry

DetailEntry addDetailEntry(Name name)
                           throws SOAPException
Creates a new DetailEntry object with the given name and adds it to this Detail object.

Parameters:
name - a Name object identifying the new DetailEntry object
Throws:
SOAPException - thrown when there is a problem in adding a DetailEntry object to this Detail object.
See Also:
addDetailEntry(QName qname)

public DetailEntry addDetailEntry(javax.xml.namespace.QName qname) throws SOAPException
使用给定 QName 创建新的 DetailEntry 对象,并将其添加到此 Detail 对象。与使用 Name 的方法相比,应优先考虑此方法。
qname 标识新 DetailEntry 对象的 QName 对象
ThrowsSOAPException: 当将 DetailEntry 对象添加到此 Detail 对象过程中存在问题时,抛出该异常。
sinceSAAJ 1.3
See also addDetailEntry(Name name)
英文文档:

addDetailEntry

DetailEntry addDetailEntry(QName qname)
                           throws SOAPException
Creates a new DetailEntry object with the given QName and adds it to this Detail object. This method is the preferred over the one using Name.

Parameters:
qname - a QName object identifying the new DetailEntry object
Throws:
SOAPException - thrown when there is a problem in adding a DetailEntry object to this Detail object.
Since:
SAAJ 1.3
See Also:
addDetailEntry(Name name)

public java.util.Iterator<E> getDetailEntries()
获取在此 Detail 对象中所有 DetailEntry 上进行迭代的迭代器。
return 一个 Iterator 对象,可在此 Detail 对象中的 DetailEntry 对象上进行迭代
英文文档:

getDetailEntries

Iterator getDetailEntries()
Gets an Iterator over all of the DetailEntrys in this Detail object.

Returns:
an Iterator object over the DetailEntry objects in this Detail object


Submit a bug or feature

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

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

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