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