< prev index next >

src/java.base/share/classes/java/net/ContentHandler.java

Print this page




  30 /**
  31  * The abstract class {@code ContentHandler} is the superclass
  32  * of all classes that read an {@code Object} from a
  33  * {@code URLConnection}.
  34  * <p>
  35  * An application does not generally call the
  36  * {@code getContent} method in this class directly. Instead, an
  37  * application calls the {@code getContent} method in class
  38  * {@code URL} or in {@code URLConnection}.
  39  * The application's content handler factory (an instance of a class that
  40  * implements the interface {@code ContentHandlerFactory} set
  41  * up by a call to {@code setContentHandler}) is
  42  * called with a {@code String} giving the MIME type of the
  43  * object being received on the socket. The factory returns an
  44  * instance of a subclass of {@code ContentHandler}, and its
  45  * {@code getContent} method is called to create the object.
  46  * <p>
  47  * If no content handler could be {@linkplain URLConnection#getContent() found},
  48  * URLConnection will look for a content handler in a user-definable set of places.
  49  * Users can define a vertical-bar delimited set of class prefixes
  50  * to search through by defining the <i>{@value java.net.URLConnection#contentPathProp}</i>
  51  * property. The class name must be of the form:
  52  * <blockquote>
  53  *     <i>{package-prefix}.{major}.{minor}</i>
  54  *     <p>
  55  *     where <i>{major}.{minor}</i> is formed by taking the
  56  *     content-type string, replacing all slash characters with a
  57  *     {@code period} ('.'), and all other non-alphanumeric characters
  58  *     with the underscore character '{@code _}'. The alphanumeric
  59  *     characters are specifically the 26 uppercase ASCII letters
  60  *     '{@code A}' through '{@code Z}', the 26 lowercase ASCII
  61  *     letters '{@code a}' through '{@code z}', and the 10 ASCII
  62  *     digits '{@code 0}' through '{@code 9}'.
  63  *     <p>
  64  *     e.g.
  65  *     YoyoDyne.experimental.text.plain
  66  * </blockquote>
  67  * If no user-defined content handler is found, then the system
  68  * tries to load a specific <i>content-type</i> handler from one
  69  * of the built-in handlers, if one exists.
  70  * <p>




  30 /**
  31  * The abstract class {@code ContentHandler} is the superclass
  32  * of all classes that read an {@code Object} from a
  33  * {@code URLConnection}.
  34  * <p>
  35  * An application does not generally call the
  36  * {@code getContent} method in this class directly. Instead, an
  37  * application calls the {@code getContent} method in class
  38  * {@code URL} or in {@code URLConnection}.
  39  * The application's content handler factory (an instance of a class that
  40  * implements the interface {@code ContentHandlerFactory} set
  41  * up by a call to {@code setContentHandler}) is
  42  * called with a {@code String} giving the MIME type of the
  43  * object being received on the socket. The factory returns an
  44  * instance of a subclass of {@code ContentHandler}, and its
  45  * {@code getContent} method is called to create the object.
  46  * <p>
  47  * If no content handler could be {@linkplain URLConnection#getContent() found},
  48  * URLConnection will look for a content handler in a user-definable set of places.
  49  * Users can define a vertical-bar delimited set of class prefixes
  50  * to search through by defining the <i>{@link java.net.URLConnection#contentPathProp}</i>
  51  * property. The class name must be of the form:
  52  * <blockquote>
  53  *     <i>{package-prefix}.{major}.{minor}</i>
  54  *     <p>
  55  *     where <i>{major}.{minor}</i> is formed by taking the
  56  *     content-type string, replacing all slash characters with a
  57  *     {@code period} ('.'), and all other non-alphanumeric characters
  58  *     with the underscore character '{@code _}'. The alphanumeric
  59  *     characters are specifically the 26 uppercase ASCII letters
  60  *     '{@code A}' through '{@code Z}', the 26 lowercase ASCII
  61  *     letters '{@code a}' through '{@code z}', and the 10 ASCII
  62  *     digits '{@code 0}' through '{@code 9}'.
  63  *     <p>
  64  *     e.g.
  65  *     YoyoDyne.experimental.text.plain
  66  * </blockquote>
  67  * If no user-defined content handler is found, then the system
  68  * tries to load a specific <i>content-type</i> handler from one
  69  * of the built-in handlers, if one exists.
  70  * <p>


< prev index next >