java.net
Class ContentHandler
java.lang.Object
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()
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContentHandler
public ContentHandler()
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 objecttypes - 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.
Please submit a feedback, bug or feature