jdk/src/java.base/share/classes/java/net/ContentHandler.java
changeset 44601 2aa0e48dae05
parent 32649 2ee9017c7597
equal deleted inserted replaced
44600:2027ac642982 44601:2aa0e48dae05
    35  * An application does not generally call the
    35  * An application does not generally call the
    36  * {@code getContent} method in this class directly. Instead, an
    36  * {@code getContent} method in this class directly. Instead, an
    37  * application calls the {@code getContent} method in class
    37  * application calls the {@code getContent} method in class
    38  * {@code URL} or in {@code URLConnection}.
    38  * {@code URL} or in {@code URLConnection}.
    39  * The application's content handler factory (an instance of a class that
    39  * The application's content handler factory (an instance of a class that
    40  * implements the interface {@code ContentHandlerFactory} set
    40  * implements the interface {@code ContentHandlerFactory} set up by a call to
    41  * up by a call to {@code setContentHandler}) is
    41  * {@link URLConnection#setContentHandlerFactory(ContentHandlerFactory)
    42  * called with a {@code String} giving the MIME type of the
    42  * setContentHandlerFactory} is called with a {@code String} giving the
    43  * object being received on the socket. The factory returns an
    43  * MIME type of the object being received on the socket. The factory returns an
    44  * instance of a subclass of {@code ContentHandler}, and its
    44  * instance of a subclass of {@code ContentHandler}, and its
    45  * {@code getContent} method is called to create the object.
    45  * {@code getContent} method is called to create the object.
    46  * <p>
    46  * <p>
    47  * If no content handler could be {@linkplain URLConnection#getContent() found},
    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.
    48  * URLConnection will look for a content handler in a user-definable set of places.
    97     /**
    97     /**
    98      * Given a URL connect stream positioned at the beginning of the
    98      * Given a URL connect stream positioned at the beginning of the
    99      * representation of an object, this method reads that stream and
    99      * representation of an object, this method reads that stream and
   100      * creates an object that matches one of the types specified.
   100      * creates an object that matches one of the types specified.
   101      *
   101      *
   102      * The default implementation of this method should call getContent()
   102      * The default implementation of this method should call
       
   103      * {@link #getContent(URLConnection)}
   103      * and screen the return type for a match of the suggested types.
   104      * and screen the return type for a match of the suggested types.
   104      *
   105      *
   105      * @param      urlc   a URL connection.
   106      * @param      urlc   a URL connection.
   106      * @param      classes      an array of types requested
   107      * @param      classes      an array of types requested
   107      * @return     the object read by the {@code ContentHandler} that is
   108      * @return     the object read by the {@code ContentHandler} that is