Package java.net
Class ContentHandler
- java.lang.Object
-
- java.net.ContentHandler
-
public abstract class ContentHandler extends Object
This class converts the content of a certain format (i.e. a MIME type) into a Java type object. It is created byContentHandlerFactory. The data values should be accessed viaURLorURLConnection.
-
-
Constructor Summary
Constructors Constructor Description ContentHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ObjectgetContent(URLConnection uConn)Returns the object pointed by the specified URL connectionuConn.ObjectgetContent(URLConnection uConn, Class[] types)Returns the object pointed by the specified URL connectionuConn.
-
-
-
Method Detail
-
getContent
public abstract Object getContent(URLConnection uConn) throws IOException
Returns the object pointed by the specified URL connectionuConn.- Parameters:
uConn- URL connection that points to the desired object.- Returns:
- object referred by
uConn. - Throws:
IOException- 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 connectionuConn.- Parameters:
uConn- URL connection that points to the desired object.types- list of acceptable content types.- Returns:
- resource object pointed by this URL or
nullif the content doesn't match one of the specified content types. - Throws:
IOException- if an error occurred while obtaining the content.
-
-