Java™ Platform
Standard Ed. 8
compact1, compact2, compact3
java.net
Class ContentHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods
| Modifier and Type |
Method |
Description |
abstract Object |
getContent(URLConnection urlc) |
Given a URL connect stream positioned at the beginning of the
representation of an object, this method reads that stream and
creates an object from it.
|
Object |
getContent(URLConnection urlc,
Class[] classes) |
Given a URL connect stream positioned at the beginning of the
representation of an object, this method reads that stream and
creates an object that matches one of the types specified.
|
-
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 urlc)
throws IOException
Given a URL connect stream positioned at the beginning of the
representation of an object, this method reads that stream and
creates an object from it.
- Parameters:
urlc - a URL connection.
- Returns:
- the object read by the
ContentHandler.
- Throws:
IOException - if an I/O error occurs while reading the object.
-
getContent
public Object getContent(URLConnection urlc,
Class[] classes)
throws IOException
Given a URL connect stream positioned at the beginning of the
representation of an object, this method reads that stream and
creates an object that matches one of the types specified.
The default implementation of this method should call getContent()
and screen the return type for a match of the suggested types.
- Parameters:
urlc - a URL connection.
classes - an array of types requested
- Returns:
- the object read by the
ContentHandler that is
the first match of the suggested types.
null if none of the requested are supported.
- Throws:
IOException - if an I/O error occurs while reading the object.
- Since:
- 1.3
Java™ Platform
Standard Ed. 8
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.