001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied. See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019
020 package javax.xml.soap;
021
022 import javax.xml.namespace.QName;
023 import java.util.Iterator;
024
025 /**
026 * A container for <code>DetailEntry</code> objects. <code>DetailEntry</code> objects give detailed
027 * error information that is application-specific and related to the <code>SOAPBody</code> object
028 * that contains it.
029 * <p/>
030 * A <code>Detail</code> object, which is part of a <code>SOAPFault</code> object, can be retrieved
031 * using the method <code>SOAPFault.getDetail</code>. The <code>Detail</code> interface provides two
032 * methods. One creates a new <code>DetailEntry</code> object and also automatically adds it to the
033 * <code>Detail</code> object. The second method gets a list of the <code>DetailEntry</code> objects
034 * contained in a <code>Detail</code> object.
035 * <p/>
036 * The following code fragment, in which <i>sf</i> is a <code>SOAPFault</code> object, gets its
037 * <code>Detail</code> object (<i>d</i>), adds a new <code>DetailEntry</code> object to <i>d</i>,
038 * and then gets a list of all the <code>DetailEntry</code> objects in <i>d</i>. The code also
039 * creates a <code>Name</code> object to pass to the method <code>addDetailEntry</code>. The
040 * variable <i>se</i>, used to create the <code>Name</code> object, is a <code>SOAPEnvelope</code>
041 * object. <PRE> Detail d = sf.getDetail(); Name name = se.createName("GetLastTradePrice", "WOMBAT",
042 * "http://www.wombat.org/trader"); d.addDetailEntry(name); Iterator it = d.getDetailEntries();
043 * </PRE>
044 */
045 public interface Detail extends SOAPFaultElement {
046
047 /**
048 * Creates a new <code>DetailEntry</code> object with the given name and adds it to this
049 * <code>Detail</code> object.
050 *
051 * @param name a <code>Name</code> object identifying the new <code>DetailEntry</code> object
052 * @return DetailEntry.
053 * @throws SOAPException thrown when there is a problem in adding a DetailEntry object to this
054 * Detail object.
055 */
056 public abstract DetailEntry addDetailEntry(Name name) throws SOAPException;
057
058 /**
059 * Gets a list of the detail entries in this <code>Detail</code> object.
060 *
061 * @return an <code>Iterator</code> object over the <code>DetailEntry</code> objects in this
062 * <code>Detail</code> object
063 */
064 public abstract Iterator getDetailEntries();
065
066 public abstract DetailEntry addDetailEntry(QName qname)
067 throws SOAPException;
068 }