Packages  This Package  Prev  Next  Index  

§4.1 Class ContentHandler

public  abstract  class
    extends  java.lang.Object  (I-§1.12)
        // Constructors
    public ContentHandler();	§4.1.1

        // Methods
    public abstract Object getContent(URLConnection  urlc);	§4.1.2
The abstract class ContentHandler is the superclass of all classes that read an Object from a URLConnection (I-§4.9).

An application does not generally call the getContentHandler method (I-§4.1.2) in this class directly. Instead, an application calls the getContent method in class URL (I-§4.8.6) or in URL----Connection (I-§4.9.11). The application's content handler factory (an instance of a class that implements the interface ContentHandlerFactory (I-§4.12) set up by a call to set-Content-Handler (I-§4.9.37)) is called with a String giving the MIME type of the object being received on the socket. The factory returns an instance of a subclass of ContentHandler, and its getContent method is called to create the object.



public ContentHandler()
The default constructor for class ContentHandler.



public abstract Object getContent(URLConnection urlc) throws IOException
Given an URL connect stream positioned at the beginning of the representation of an object, this method reads that stream and creates an object from it.
urlc - a URL connection
The object read by the ContentHandler.
IOException (I-§2.29)
If an IO error occurs while reading the object.

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to