01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package javax.xml.soap;
21:
22: import javax.xml.namespace.QName;
23: import java.util.Iterator;
24:
25: /**
26: * A container for <code>DetailEntry</code> objects. <code>DetailEntry</code> objects give detailed
27: * error information that is application-specific and related to the <code>SOAPBody</code> object
28: * that contains it.
29: * <p/>
30: * A <code>Detail</code> object, which is part of a <code>SOAPFault</code> object, can be retrieved
31: * using the method <code>SOAPFault.getDetail</code>. The <code>Detail</code> interface provides two
32: * methods. One creates a new <code>DetailEntry</code> object and also automatically adds it to the
33: * <code>Detail</code> object. The second method gets a list of the <code>DetailEntry</code> objects
34: * contained in a <code>Detail</code> object.
35: * <p/>
36: * The following code fragment, in which <i>sf</i> is a <code>SOAPFault</code> object, gets its
37: * <code>Detail</code> object (<i>d</i>), adds a new <code>DetailEntry</code> object to <i>d</i>,
38: * and then gets a list of all the <code>DetailEntry</code> objects in <i>d</i>. The code also
39: * creates a <code>Name</code> object to pass to the method <code>addDetailEntry</code>. The
40: * variable <i>se</i>, used to create the <code>Name</code> object, is a <code>SOAPEnvelope</code>
41: * object. <PRE> Detail d = sf.getDetail(); Name name = se.createName("GetLastTradePrice", "WOMBAT",
42: * "http://www.wombat.org/trader"); d.addDetailEntry(name); Iterator it = d.getDetailEntries();
43: * </PRE>
44: */
45: public interface Detail extends SOAPFaultElement {
46:
47: /**
48: * Creates a new <code>DetailEntry</code> object with the given name and adds it to this
49: * <code>Detail</code> object.
50: *
51: * @param name a <code>Name</code> object identifying the new <code>DetailEntry</code> object
52: * @return DetailEntry.
53: * @throws SOAPException thrown when there is a problem in adding a DetailEntry object to this
54: * Detail object.
55: */
56: public abstract DetailEntry addDetailEntry(Name name)
57: throws SOAPException;
58:
59: /**
60: * Gets a list of the detail entries in this <code>Detail</code> object.
61: *
62: * @return an <code>Iterator</code> object over the <code>DetailEntry</code> objects in this
63: * <code>Detail</code> object
64: */
65: public abstract Iterator getDetailEntries();
66:
67: public abstract DetailEntry addDetailEntry(QName qname)
68: throws SOAPException;
69: }
|