< prev index next >

src/java.activation/share/classes/javax/activation/DataHandler.java

Print this page

        

@@ -52,15 +52,15 @@
  * object corresponding to the MIME type of the data represented in
  * the specific instance of the DataHandler.<p>
  *
  * <b>DataHandler and CommandMaps</b><p>
  * The DataHandler keeps track of the current CommandMap that it uses to
- * service requests for commands (<code>getCommand</code>,
- * <code>getAllCommands</code>, <code>getPreferredCommands</code>).
+ * service requests for commands ({@code getCommand, getAllCommands, 
+ * getPreferredCommands}).
  * Each instance of a DataHandler may have a CommandMap associated with
- * it using the <code>setCommandMap</code> method.  If a CommandMap was
- * not set, DataHandler calls the <code>getDefaultCommandMap</code>
+ * it using the {@code setCommandMap} method.  If a CommandMap was
+ * not set, DataHandler calls the {@code getDefaultCommandMap}
  * method in CommandMap and uses the value it returns. See
  * <i>CommandMap</i> for more information. <p>
  *
  * <b>DataHandler and URLs</b><p>
  * The current DataHandler implementation creates a private

@@ -103,11 +103,11 @@
     private DataContentHandlerFactory oldFactory = null;
     // the short representation of the ContentType (sans params)
     private String shortType = null;
 
     /**
-     * Create a <code>DataHandler</code> instance referencing the
+     * Create a {@code DataHandler} instance referencing the
      * specified DataSource.  The data exists in a byte stream form.
      * The DataSource will provide an InputStream to access the data.
      *
      * @param ds        the DataSource
      */

@@ -116,11 +116,11 @@
         dataSource = ds;
         oldFactory = factory; // keep track of the factory
     }
 
     /**
-     * Create a <code>DataHandler</code> instance representing an object
+     * Create a {@code DataHandler} instance representing an object
      * of this MIME type.  This constructor is
      * used when the application already has an in-memory representation
      * of the data in the form of a Java Object.
      *
      * @param obj       the Java Object

@@ -131,12 +131,12 @@
         objectMimeType = mimeType;
         oldFactory = factory; // keep track of the factory
     }
 
     /**
-     * Create a <code>DataHandler</code> instance referencing a URL.
-     * The DataHandler internally creates a <code>URLDataSource</code>
+     * Create a {@code DataHandler} instance referencing a URL.
+     * The DataHandler internally creates a {@code URLDataSource}
      * instance to represent the URL.
      *
      * @param url       a URL object
      */
     public DataHandler(URL url) {

@@ -179,11 +179,11 @@
     }
 
     /**
      * Return the name of the data object. If this DataHandler
      * was created with a DataSource, this method calls through
-     * to the <code>DataSource.getName</code> method, otherwise it
+     * to the {@code DataSource.getName} method, otherwise it
      * returns <i>null</i>.
      *
      * @return  the name of the object
      */
     public String getName() {

@@ -209,23 +209,23 @@
 
     /**
      * Get the InputStream for this object. <p>
      *
      * For DataHandlers instantiated with a DataSource, the DataHandler
-     * calls the <code>DataSource.getInputStream</code> method and
+     * calls the {@code DataSource.getInputStream} method and
      * returns the result to the caller.
      * <p>
      * For DataHandlers instantiated with an Object, the DataHandler
      * first attempts to find a DataContentHandler for the Object. If
      * the DataHandler can not find a DataContentHandler for this MIME
      * type, it throws an UnsupportedDataTypeException.  If it is
      * successful, it creates a pipe and a thread.  The thread uses the
-     * DataContentHandler's <code>writeTo</code> method to write the
+     * DataContentHandler's {@code writeTo} method to write the
      * stream data into one end of the pipe.  The other end of the pipe
      * is returned to the caller.  Because a thread is created to copy
      * the data, IOExceptions that may occur during the copy can not be
-     * propagated back to the caller. The result is an empty stream.<p>
+     * propagated back to the caller. The result is an empty stream.
      *
      * @return  the InputStream representing this data
      * @exception IOException   if an I/O error occurs
      *
      * @see javax.activation.DataContentHandler#writeTo

@@ -279,20 +279,20 @@
 
         return ins;
     }
 
     /**
-     * Write the data to an <code>OutputStream</code>.<p>
+     * Write the data to an {@code OutputStream}.<p>
      *
      * If the DataHandler was created with a DataSource, writeTo
      * retrieves the InputStream and copies the bytes from the
      * InputStream to the OutputStream passed in.
      * <p>
      * If the DataHandler was created with an object, writeTo
      * retrieves the DataContentHandler for the object's type.
      * If the DataContentHandler was found, it calls the
-     * <code>writeTo</code> method on the <code>DataContentHandler</code>.
+     * {@code writeTo} method on the {@code DataContentHandler}.
      *
      * @param os        the OutputStream to write to
      * @exception IOException   if an I/O error occurs
      */
     public void writeTo(OutputStream os) throws IOException {

@@ -320,12 +320,12 @@
 
     /**
      * Get an OutputStream for this DataHandler to allow overwriting
      * the underlying data.
      * If the DataHandler was created with a DataSource, the
-     * DataSource's <code>getOutputStream</code> method is called.
-     * Otherwise, <code>null</code> is returned.
+     * DataSource's {@code getOutputStream} method is called.
+     * Otherwise, {@code null} is returned.
      *
      * @return the OutputStream
      *
      * @see javax.activation.DataSource#getOutputStream
      * @see javax.activation.URLDataSource

@@ -346,16 +346,16 @@
      * richly descriptive to least richly descriptive.<p>
      *
      * The DataHandler attempts to find a DataContentHandler that
      * corresponds to the MIME type of the data. If one is located,
      * the DataHandler calls the DataContentHandler's
-     * <code>getTransferDataFlavors</code> method. <p>
+     * {@code getTransferDataFlavors} method. <p>
      *
      * If a DataContentHandler can <i>not</i> be located, and if the
      * DataHandler was created with a DataSource (or URL), one
      * DataFlavor is returned that represents this object's MIME type
-     * and the <code>java.io.InputStream</code> class.  If the
+     * and the {@code java.io.InputStream} class.  If the
      * DataHandler was created with an object and a MIME type,
      * getTransferDataFlavors returns one DataFlavor that represents
      * this object's MIME type and the object's class.
      *
      * @return  an array of data flavors in which this data can be transferred

@@ -379,11 +379,11 @@
     /**
      * Returns whether the specified data flavor is supported
      * for this object.<p>
      *
      * This method iterates through the DataFlavors returned from
-     * <code>getTransferDataFlavors</code>, comparing each with
+     * {@code getTransferDataFlavors}, comparing each with
      * the specified flavor.
      *
      * @param flavor    the requested flavor for the data
      * @return          true if the data flavor is supported
      * @see javax.activation.DataHandler#getTransferDataFlavors

@@ -405,14 +405,14 @@
      *
      * <b>For DataHandler's created with DataSources or URLs:</b><p>
      *
      * The DataHandler attempts to locate a DataContentHandler
      * for this MIME type. If one is found, the passed in DataFlavor
-     * and the type of the data are passed to its <code>getTransferData</code>
+     * and the type of the data are passed to its {@code getTransferData}
      * method. If the DataHandler fails to locate a DataContentHandler
      * and the flavor specifies this object's MIME type and the
-     * <code>java.io.InputStream</code> class, this object's InputStream
+     * {@code java.io.InputStream} class, this object's InputStream
      * is returned.
      * Otherwise it throws an UnsupportedFlavorException. <p>
      *
      * <b>For DataHandler's created with Objects:</b><p>
      *

@@ -436,14 +436,14 @@
         return getDataContentHandler().getTransferData(flavor, dataSource);
     }
 
     /**
      * Set the CommandMap for use by this DataHandler.
-     * Setting it to <code>null</code> causes the CommandMap to revert
+     * Setting it to {@code null} causes the CommandMap to revert
      * to the CommandMap returned by the
-     * <code>CommandMap.getDefaultCommandMap</code> method.
-     * Changing the CommandMap, or setting it to <code>null</code>,
+     * {@code CommandMap.getDefaultCommandMap} method.
+     * Changing the CommandMap, or setting it to {@code null},
      * clears out any data cached from the previous CommandMap.
      *
      * @param commandMap        the CommandMap to use in this DataHandler
      *
      * @see javax.activation.CommandMap#setDefaultCommandMap

@@ -458,11 +458,11 @@
         }
     }
 
     /**
      * Return the <i>preferred</i> commands for this type of data.
-     * This method calls the <code>getPreferredCommands</code> method
+     * This method calls the {@code getPreferredCommands} method
      * in the CommandMap associated with this instance of DataHandler.
      * This method returns an array that represents a subset of
      * available commands. In cases where multiple commands for the
      * MIME type represented by this DataHandler are present, the
      * installed CommandMap chooses the appropriate commands.

@@ -482,11 +482,11 @@
     /**
      * Return all the commands for this type of data.
      * This method returns an array containing all commands
      * for the type of data represented by this DataHandler. The
      * MIME type for the underlying data represented by this DataHandler
-     * is used to call through to the <code>getAllCommands</code> method
+     * is used to call through to the {@code getAllCommands} method
      * of the CommandMap associated with this DataHandler.
      *
      * @return  the CommandInfo objects representing all the commands
      *
      * @see javax.activation.CommandMap#getAllCommands

@@ -500,11 +500,11 @@
 
     /**
      * Get the command <i>cmdName</i>. Use the search semantics as
      * defined by the CommandMap installed in this DataHandler. The
      * MIME type for the underlying data represented by this DataHandler
-     * is used to call through to the <code>getCommand</code> method
+     * is used to call through to the {@code getCommand} method
      * of the CommandMap associated with this DataHandler.
      *
      * @param cmdName   the command name
      * @return  the CommandInfo corresponding to the command
      *

@@ -525,11 +525,11 @@
      * the object. <p>
      *
      * If the DataHandler was instantiated with a DataSource,
      * this method uses a DataContentHandler to return the content
      * object for the data represented by this DataHandler. If no
-     * <code>DataContentHandler</code> can be found for the
+     * {@code DataContentHandler} can be found for the
      * the type of this data, the DataHandler returns an
      * InputStream for the data.
      *
      * @return the content.
      * @exception IOException if an IOException occurs during

@@ -545,13 +545,13 @@
     /**
      * A convenience method that takes a CommandInfo object
      * and instantiates the corresponding command, usually
      * a JavaBean component.
      * <p>
-     * This method calls the CommandInfo's <code>getCommandObject</code>
-     * method with the <code>ClassLoader</code> used to load
-     * the <code>javax.activation.DataHandler</code> class itself.
+     * This method calls the CommandInfo's {@code getCommandObject}
+     * method with the {@code ClassLoader} used to load
+     * the {@code javax.activation.DataHandler} class itself.
      *
      * @param cmdinfo   the CommandInfo corresponding to a command
      * @return  the instantiated command object
      */
     public Object getBean(CommandInfo cmdinfo) {

@@ -699,20 +699,20 @@
     public DataHandlerDataSource(DataHandler dh) {
         this.dataHandler = dh;
     }
 
     /**
-     * Returns an <code>InputStream</code> representing this object.
-     * @return  the <code>InputStream</code>
+     * Returns an {@code InputStream} representing this object.
+     * @return  the {@code InputStream}
      */
     public InputStream getInputStream() throws IOException {
         return dataHandler.getInputStream();
     }
 
     /**
-     * Returns the <code>OutputStream</code> for this object.
-     * @return  the <code>OutputStream</code>
+     * Returns the {@code OutputStream} for this object.
+     * @return  the {@code OutputStream}
      */
     public OutputStream getOutputStream() throws IOException {
         return dataHandler.getOutputStream();
     }
 

@@ -752,11 +752,11 @@
         this.ds = ds;
         this.dch = dch;
     }
 
     /**
-     * Return the DataFlavors for this <code>DataContentHandler</code>.
+     * Return the DataFlavors for this {@code DataContentHandler}.
      * @return  the DataFlavors
      */
     public DataFlavor[] getTransferDataFlavors() {
 
         if (transferFlavors == null) {

@@ -840,11 +840,11 @@
     public DataContentHandler getDCH() {
         return dch;
     }
 
     /**
-     * Return the DataFlavors for this <code>DataContentHandler</code>.
+     * Return the DataFlavors for this {@code DataContentHandler}.
      * @return  the DataFlavors
      */
     public synchronized DataFlavor[] getTransferDataFlavors() {
         if (transferFlavors == null) {
             if (dch != null) {
< prev index next >