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 java.util.Iterator;
023    
024    /**
025     * A container for <code>DetailEntry</code> objects. <code>DetailEntry</code>
026     * objects give detailed error information that is application-specific and
027     * related to the <code>SOAPBody</code> object that contains it.
028     * <P>
029     * A <code>Detail</code> object, which is part of a <code>SOAPFault</code>
030     * object, can be retrieved using the method <code>SOAPFault.getDetail</code>.
031     * The <code>Detail</code> interface provides two methods. One creates a new
032     * <code>DetailEntry</code> object and also automatically adds it to
033     * the <code>Detail</code> object. The second method gets a list of the
034     * <code>DetailEntry</code> objects contained in a <code>Detail</code>
035     * object.
036     * <P>
037     * The following code fragment, in which <i>sf</i> is a <code>SOAPFault</code>
038     * object, gets its <code>Detail</code> object (<i>d</i>), adds a new
039     * <code>DetailEntry</code> object to <i>d</i>, and then gets a list of all the
040     * <code>DetailEntry</code> objects in <i>d</i>. The code also creates a
041     * <code>Name</code> object to pass to the method <code>addDetailEntry</code>.
042     * The variable <i>se</i>, used to create the <code>Name</code> object,
043     * is a <code>SOAPEnvelope</code> object.
044     * <PRE>
045     *    Detail d = sf.getDetail();
046     *    Name name = se.createName("GetLastTradePrice", "WOMBAT",
047     *                                "http://www.wombat.org/trader");
048     *    d.addDetailEntry(name);
049     *    Iterator it = d.getDetailEntries();
050     * </PRE>
051     */
052    public interface Detail extends SOAPFaultElement {
053    
054        /**
055         * Creates a new <code>DetailEntry</code> object with the given
056         * name and adds it to this <code>Detail</code> object.
057         * @param   name a <code>Name</code> object identifying the new <code>DetailEntry</code> object
058         * @return DetailEntry.
059         * @throws SOAPException  thrown when there is a problem in adding a DetailEntry object to this Detail object.
060         */
061        public abstract DetailEntry addDetailEntry(Name name) throws SOAPException;
062    
063        /**
064         * Gets a list of the detail entries in this <code>Detail</code> object.
065         * @return  an <code>Iterator</code> object over the <code>DetailEntry</code>
066         *        objects in this <code>Detail</code> object
067         */
068        public abstract Iterator getDetailEntries();
069    }