Build 1.0_r1(from source)

java.net
Class ContentHandler

java.lang.Object
  extended by java.net.ContentHandler
Direct Known Subclasses:
URLConnection.DefaultContentHandler

public abstract class ContentHandler
extends Object

This class converts the content of a certain format into a Java type Object. It is implemented differently for each content type in each platform. It is created by ContentHandlerFactory

See Also:
ContentHandlerFactory, URL, URLConnection.getContent()

Constructor Summary
ContentHandler()
           
 
Method Summary
abstract  Object getContent(URLConnection uConn)
          Returns the object pointed by the specified URL Connection uConn.
 Object getContent(URLConnection uConn, Class[] types)
          Returns the object pointed by the specified URL Connection uConn.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentHandler

public ContentHandler()
Method Detail

getContent

public abstract Object getContent(URLConnection uConn)
                           throws IOException
Returns the object pointed by the specified URL Connection uConn.

Parameters:
uConn - URLConnection the URL connection that points to the desired object
Returns:
java.lang.Object the object referred by uConn
Throws:
IOException - thrown if an IO error occurs during the retrieval of the object

getContent

public Object getContent(URLConnection uConn,
                         Class[] types)
                  throws IOException
Returns the object pointed by the specified URL Connection uConn.

Parameters:
uConn - java.net.URLConnection the URL connection that points to the desired object
types - The list of acceptable content types
Returns:
Object The object of the resource pointed by this URL, or null if the content does not match a specified content type.
Throws:
IOException - If an error occurred obtaining the content.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature