KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > soap > Detail


1 /*
2  * $Id: Detail.java,v 1.8 2005/04/05 20:34:16 mk125090 Exp $
3  * $Revision: 1.8 $
4  * $Date: 2005/04/05 20:34:16 $
5  */

6
7 /*
8  * The contents of this file are subject to the terms
9  * of the Common Development and Distribution License
10  * (the License). You may not use this file except in
11  * compliance with the License.
12  *
13  * You can obtain a copy of the license at
14  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
15  * See the License for the specific language governing
16  * permissions and limitations under the License.
17  *
18  * When distributing Covered Code, include this CDDL
19  * Header Notice in each file and include the License file
20  * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
21  * If applicable, add the following below the CDDL Header,
22  * with the fields enclosed by brackets [] replaced by
23  * you own identifying information:
24  * "Portions Copyrighted [year] [name of copyright owner]"
25  *
26  * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
27  */

28 package javax.xml.soap;
29
30 import java.util.Iterator JavaDoc;
31
32 import javax.xml.namespace.QName JavaDoc;
33
34 /**
35  * A container for <code>DetailEntry</code> objects. <code>DetailEntry</code>
36  * objects give detailed error information that is application-specific and
37  * related to the <code>SOAPBody</code> object that contains it.
38  *<P>
39  * A <code>Detail</code> object, which is part of a <code>SOAPFault</code>
40  * object, can be retrieved using the method <code>SOAPFault.getDetail</code>.
41  * The <code>Detail</code> interface provides two methods. One creates a new
42  * <code>DetailEntry</code> object and also automatically adds it to
43  * the <code>Detail</code> object. The second method gets a list of the
44  * <code>DetailEntry</code> objects contained in a <code>Detail</code>
45  * object.
46  * <P>
47  * The following code fragment, in which <i>sf</i> is a <code>SOAPFault</code>
48  * object, gets its <code>Detail</code> object (<i>d</i>), adds a new
49  * <code>DetailEntry</code> object to <i>d</i>, and then gets a list of all the
50  * <code>DetailEntry</code> objects in <i>d</i>. The code also creates a
51  * <code>Name</code> object to pass to the method <code>addDetailEntry</code>.
52  * The variable <i>se</i>, used to create the <code>Name</code> object,
53  * is a <code>SOAPEnvelope</code> object.
54  * <PRE>
55  * Detail d = sf.getDetail();
56  * Name name = se.createName("GetLastTradePrice", "WOMBAT",
57  * "http://www.wombat.org/trader");
58  * d.addDetailEntry(name);
59  * Iterator it = d.getDetailEntries();
60  * </PRE>
61  */

62 public interface Detail extends SOAPFaultElement JavaDoc {
63
64     /**
65      * Creates a new <code>DetailEntry</code> object with the given
66      * name and adds it to this <code>Detail</code> object.
67      *
68      * @param name a <code>Name</code> object identifying the
69      * new <code>DetailEntry</code> object
70      *
71      * @exception SOAPException thrown when there is a problem in adding a
72      * DetailEntry object to this Detail object.
73      *
74      * @see Detail#addDetailEntry(QName qname)
75      */

76     public DetailEntry JavaDoc addDetailEntry(Name JavaDoc name) throws SOAPException JavaDoc;
77
78     /**
79      * Creates a new <code>DetailEntry</code> object with the given
80      * QName and adds it to this <code>Detail</code> object. This method
81      * is the preferred over the one using Name.
82      *
83      * @param qname a <code>QName</code> object identifying the
84      * new <code>DetailEntry</code> object
85      *
86      * @exception SOAPException thrown when there is a problem in adding a
87      * DetailEntry object to this Detail object.
88      *
89      * @see Detail#addDetailEntry(Name name)
90      * @since SAAJ 1.3
91      */

92     public DetailEntry JavaDoc addDetailEntry(QName JavaDoc qname) throws SOAPException JavaDoc;
93
94     /**
95      * Gets an Iterator over all of the <code>DetailEntry</code>s in this <code>Detail</code> object.
96      *
97      * @return an <code>Iterator</code> object over the <code>DetailEntry</code>
98      * objects in this <code>Detail</code> object
99      */

100     public Iterator JavaDoc getDetailEntries();
101 }
102
Popular Tags