home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / ContentHandler.java < prev    next >
Text File  |  1997-05-20  |  3KB  |  67 lines

  1. /*
  2.  * @(#)ContentHandler.java    1.7 97/02/10
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.net;
  24.  
  25. import java.io.IOException;
  26.  
  27. /**
  28.  * The abstract class <code>ContentHandler</code> is the superclass 
  29.  * of all classes that read an <code>Object</code> from a 
  30.  * <code>URLConnection</code>. 
  31.  * <p>
  32.  * An application does not generally call the 
  33.  * <code>getContent</code> method in this class directly. Instead, an 
  34.  * application calls the <code>getContent</code> method in class 
  35.  * <code>URL</code> or in <code>URLConnection</code>.
  36.  * The application's content handler factory (an instance of a class that 
  37.  * implements the interface <code>ContentHandlerFactory</code> set 
  38.  * up by a call to <code>setContentHandler</code>) is 
  39.  * called with a <code>String</code> giving the MIME type of the 
  40.  * object being received on the socket. The factory returns an 
  41.  * instance of a subclass of <code>ContentHandler</code>, and its 
  42.  * <code>getContent</code> method is called to create the object. 
  43.  *
  44.  * @author  James Gosling
  45.  * @version 1.7, 02/10/97
  46.  * @see     java.net.ContentHandler#getContent(java.net.URLConnection)
  47.  * @see     java.net.ContentHandlerFactory
  48.  * @see     java.net.URL#getContent()
  49.  * @see     java.net.URLConnection
  50.  * @see     java.net.URLConnection#getContent()
  51.  * @see     java.net.URLConnection#setContentHandlerFactory(java.net.ContentHandlerFactory)
  52.  * @since   JDK1.0
  53.  */
  54. abstract public class ContentHandler {
  55.     /** 
  56.      * Given a URL connect stream positioned at the beginning of the 
  57.      * representation of an object, this method reads that stream and 
  58.      * creates an object from it. 
  59.      *
  60.      * @param      urlc   a URL connection.
  61.      * @return     the object read by the <code>ContentHandler</code>.
  62.      * @exception  IOException  if an I/O error occurs while reading the object.
  63.      * @since      JDK1.0
  64.      */
  65.     abstract public Object getContent(URLConnection urlc) throws IOException;
  66. }
  67.