Save This Page
Home » openjdk-7 » javax » xml » soap » [javadoc | source]
    1   /*
    2    * $Id: Detail.java,v 1.7 2004/04/02 01:24:17 ofung Exp $
    3    * $Revision: 1.7 $
    4    * $Date: 2004/04/02 01:24:17 $
    5    */
    6   
    7   /*
    8    * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
    9    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   10    *
   11    * This code is free software; you can redistribute it and/or modify it
   12    * under the terms of the GNU General Public License version 2 only, as
   13    * published by the Free Software Foundation.  Sun designates this
   14    * particular file as subject to the "Classpath" exception as provided
   15    * by Sun in the LICENSE file that accompanied this code.
   16    *
   17    * This code is distributed in the hope that it will be useful, but WITHOUT
   18    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   19    * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   20    * version 2 for more details (a copy is included in the LICENSE file that
   21    * accompanied this code).
   22    *
   23    * You should have received a copy of the GNU General Public License version
   24    * 2 along with this work; if not, write to the Free Software Foundation,
   25    * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   26    *
   27    * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   28    * CA 95054 USA or visit www.sun.com if you need additional information or
   29    * have any questions.
   30    */
   31   package javax.xml.soap;
   32   
   33   import java.util.Iterator;
   34   
   35   import javax.xml.namespace.QName;
   36   
   37   /**
   38    * A container for <code>DetailEntry</code> objects. <code>DetailEntry</code>
   39    * objects give detailed error information that is application-specific and
   40    * related to the <code>SOAPBody</code> object that contains it.
   41    *<P>
   42    * A <code>Detail</code> object, which is part of a <code>SOAPFault</code>
   43    * object, can be retrieved using the method <code>SOAPFault.getDetail</code>.
   44    * The <code>Detail</code> interface provides two methods. One creates a new
   45    * <code>DetailEntry</code> object and also automatically adds it to
   46    * the <code>Detail</code> object. The second method gets a list of the
   47    * <code>DetailEntry</code> objects contained in a <code>Detail</code>
   48    * object.
   49    * <P>
   50    * The following code fragment, in which <i>sf</i> is a <code>SOAPFault</code>
   51    * object, gets its <code>Detail</code> object (<i>d</i>), adds a new
   52    * <code>DetailEntry</code> object to <i>d</i>, and then gets a list of all the
   53    * <code>DetailEntry</code> objects in <i>d</i>. The code also creates a
   54    * <code>Name</code> object to pass to the method <code>addDetailEntry</code>.
   55    * The variable <i>se</i>, used to create the <code>Name</code> object,
   56    * is a <code>SOAPEnvelope</code> object.
   57    * <PRE>
   58    *    Detail d = sf.getDetail();
   59    *    Name name = se.createName("GetLastTradePrice", "WOMBAT",
   60    *                                "http://www.wombat.org/trader");
   61    *    d.addDetailEntry(name);
   62    *    Iterator it = d.getDetailEntries();
   63    * </PRE>
   64    */
   65   public interface Detail extends SOAPFaultElement {
   66   
   67       /**
   68        * Creates a new <code>DetailEntry</code> object with the given
   69        * name and adds it to this <code>Detail</code> object.
   70        *
   71        * @param name a <code>Name</code> object identifying the
   72        *         new <code>DetailEntry</code> object
   73        *
   74        * @exception SOAPException thrown when there is a problem in adding a
   75        * DetailEntry object to this Detail object.
   76        *
   77        * @see Detail#addDetailEntry(QName qname)
   78        */
   79       public DetailEntry addDetailEntry(Name name) throws SOAPException;
   80   
   81       /**
   82        * Creates a new <code>DetailEntry</code> object with the given
   83        * QName and adds it to this <code>Detail</code> object. This method
   84        * is the preferred over the one using Name.
   85        *
   86        * @param qname a <code>QName</code> object identifying the
   87        *         new <code>DetailEntry</code> object
   88        *
   89        * @exception SOAPException thrown when there is a problem in adding a
   90        * DetailEntry object to this Detail object.
   91        *
   92        * @see Detail#addDetailEntry(Name name)
   93        * @since SAAJ 1.3
   94        */
   95       public DetailEntry addDetailEntry(QName qname) throws SOAPException;
   96   
   97       /**
   98        * Gets an Iterator over all of the <code>DetailEntry</code>s in this <code>Detail</code> object.
   99        *
  100        * @return an <code>Iterator</code> object over the <code>DetailEntry</code>
  101        *             objects in this <code>Detail</code> object
  102        */
  103       public Iterator getDetailEntries();
  104   }

Save This Page
Home » openjdk-7 » javax » xml » soap » [javadoc | source]