Package java.net Previous
Previous
Java API
Java API
Index
Index
Next
Next

Class ContentHandler

Constructors , Methods

public  abstract  class  java.net.ContentHandler
    extends  java.lang.Object  
{
        // Constructors
    public ContentHandler();	

        // Methods
    public abstract Object getContent(URLConnection  urlc);	
}

The abstract class ContentHandler is the superclass of all classes that read an Object from a URLConnection .

An application does not generally call the getContentHandler method in this class directly. Instead, an application calls the getContent method in class URL or in URL----Connection . The application's content handler factory (an instance of a class that implements the interface ContentHandlerFactory set up by a call to set-Content-Handler ) 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.


Constructors


ContentHandler

public ContentHandler() 

The default constructor for class ContentHandler.


Methods


getContent

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.

Return Value:

Returns The object read by the ContentHandler.

ParameterDescription
urlc a URL connection

Throw:

IOException

If an IO error occurs while reading the object.



Top© 1996 Sun Microsystems, Inc. All rights reserved.