ContentHandlerNameContentHandlerSynopsis
DescriptionThe ContentHandler class is an abstract class that defines a method to read data from a URLConnection and then create an Object appropriate for the type of content it has read. Each subclass of ContentHandler handles a specific type of content (i.e., MIME type). You do not create ContentHandler objects directly; they are created by an object that implements the ContentHandlerFactory interface. A ContentHandlerFactory object selects and creates an appropriate ContentHandler for the content type. If you write your own ContentHandler subclasses, you should also write your own ContentHandlerFactory. The content handler factory for an application is set by a call to URLConnection.setContentHandlerFactory(). An application does not normally call the getContent() method of a ContentHandler directly; it should call URL.getContent() or URLConnection.getContent() instead. A ContentHandler works in conjunction with a URLStreamHandler, but their roles do not overlap. The URLStreamHandler deals with the specifics of a protocol, such as negotiating with a server to retrieve a resource, while the ContentHandler expects a data stream from which it can construct an object. Class Summary
public abstract class java.net.ContentHandler extends java.lang.Object { // Instance Methods public abstract Object getContent(URLConnection urlc) throws IOException; } Instance MethodsgetContent
public abstract Object getContent(URLConnection urlc) throws IOException
Inherited Methods
See AlsoContentHandlerFactory, IOException, URL, URLConnection, URLStreamHandler |
|