⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datahandler.html

📁 j2ee帮助文档软件设计/软件工程 文件格式
💻 HTML
📖 第 1 页 / 共 3 页
字号:
public boolean <B>isDataFlavorSupported</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/awt/datatransfer/DataFlavor.html" title="class or interface in java.awt.datatransfer">DataFlavor</A>&nbsp;flavor)</PRE><DL><DD>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 the specified flavor.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/awt/datatransfer/Transferable.html#isDataFlavorSupported(java.awt.datatransfer.DataFlavor)" title="class or interface in java.awt.datatransfer">isDataFlavorSupported</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/awt/datatransfer/Transferable.html" title="class or interface in java.awt.datatransfer">Transferable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>flavor</CODE> - the requested flavor for the data<DT><B>Returns:</B><DD>true if the data flavor is supported<DT><B>See Also:</B><DD><A HREF="../../javax/activation/DataHandler.html#getTransferDataFlavors()"><CODE>getTransferDataFlavors()</CODE></A></DL></DD></DL><HR><A NAME="getTransferData(java.awt.datatransfer.DataFlavor)"><!-- --></A><H3>getTransferData</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getTransferData</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/awt/datatransfer/DataFlavor.html" title="class or interface in java.awt.datatransfer">DataFlavor</A>&nbsp;flavor)                       throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/awt/datatransfer/UnsupportedFlavorException.html" title="class or interface in java.awt.datatransfer">UnsupportedFlavorException</A>,                              <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Returns an object that represents the data to be transferred. The class of the object returned is defined by the representation class of the data flavor.<p> <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> 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 is returned. Otherwise it throws an UnsupportedFlavorException. <p> <b>For DataHandler's created with Objects:</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 getTransferData method. If the DataHandler fails to locate a DataContentHandler and the flavor specifies this object's MIME type and its class, this DataHandler's referenced object is returned.   Otherwise it throws an UnsupportedFlavorException.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/awt/datatransfer/Transferable.html#getTransferData(java.awt.datatransfer.DataFlavor)" title="class or interface in java.awt.datatransfer">getTransferData</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/awt/datatransfer/Transferable.html" title="class or interface in java.awt.datatransfer">Transferable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>flavor</CODE> - the requested flavor for the data<DT><B>Returns:</B><DD>the object<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/awt/datatransfer/UnsupportedFlavorException.html" title="class or interface in java.awt.datatransfer">UnsupportedFlavorException</A></CODE> - if the data could not be                        converted to the requested flavor<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs<DT><B>See Also:</B><DD><A HREF="../../javax/activation/ActivationDataFlavor.html" title="class in javax.activation"><CODE>ActivationDataFlavor</CODE></A></DL></DD></DL><HR><A NAME="setCommandMap(javax.activation.CommandMap)"><!-- --></A><H3>setCommandMap</H3><PRE>public void <B>setCommandMap</B>(<A HREF="../../javax/activation/CommandMap.html" title="class in javax.activation">CommandMap</A>&nbsp;commandMap)</PRE><DL><DD>Set the CommandMap for use by this DataHandler. Setting it to <code>null</code> 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>, clears out any data cached from the previous CommandMap.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>commandMap</CODE> - the CommandMap to use in this DataHandler<DT><B>See Also:</B><DD><A HREF="../../javax/activation/CommandMap.html#setDefaultCommandMap(javax.activation.CommandMap)"><CODE>CommandMap.setDefaultCommandMap(javax.activation.CommandMap)</CODE></A></DL></DD></DL><HR><A NAME="getPreferredCommands()"><!-- --></A><H3>getPreferredCommands</H3><PRE>public <A HREF="../../javax/activation/CommandInfo.html" title="class in javax.activation">CommandInfo</A>[] <B>getPreferredCommands</B>()</PRE><DL><DD>Return the <i>preferred</i> commands for this type of data. This method calls the <code>getPreferredCommands</code> 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.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the CommandInfo objects representing the preferred commands<DT><B>See Also:</B><DD><A HREF="../../javax/activation/CommandMap.html#getPreferredCommands(java.lang.String)"><CODE>CommandMap.getPreferredCommands(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="getAllCommands()"><!-- --></A><H3>getAllCommands</H3><PRE>public <A HREF="../../javax/activation/CommandInfo.html" title="class in javax.activation">CommandInfo</A>[] <B>getAllCommands</B>()</PRE><DL><DD>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 of the CommandMap associated with this DataHandler.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the CommandInfo objects representing all the commands<DT><B>See Also:</B><DD><A HREF="../../javax/activation/CommandMap.html#getAllCommands(java.lang.String)"><CODE>CommandMap.getAllCommands(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="getCommand(java.lang.String)"><!-- --></A><H3>getCommand</H3><PRE>public <A HREF="../../javax/activation/CommandInfo.html" title="class in javax.activation">CommandInfo</A> <B>getCommand</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;cmdName)</PRE><DL><DD>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 of the CommandMap associated with this DataHandler.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>cmdName</CODE> - the command name<DT><B>Returns:</B><DD>the CommandInfo corresponding to the command<DT><B>See Also:</B><DD><A HREF="../../javax/activation/CommandMap.html#getCommand(java.lang.String, java.lang.String)"><CODE>CommandMap.getCommand(java.lang.String, java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="getContent()"><!-- --></A><H3>getContent</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getContent</B>()                  throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Return the data in its preferred Object form. <p> If the DataHandler was instantiated with an object, return 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 the type of this data, the DataHandler returns an InputStream for the data.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the content.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an IOException occurs during                              this operation.</DL></DD></DL><HR><A NAME="getBean(javax.activation.CommandInfo)"><!-- --></A><H3>getBean</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getBean</B>(<A HREF="../../javax/activation/CommandInfo.html" title="class in javax.activation">CommandInfo</A>&nbsp;cmdinfo)</PRE><DL><DD>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.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>cmdinfo</CODE> - the CommandInfo corresponding to a command<DT><B>Returns:</B><DD>the instantiated command object</DL></DD></DL><HR><A NAME="setDataContentHandlerFactory(javax.activation.DataContentHandlerFactory)"><!-- --></A><H3>setDataContentHandlerFactory</H3><PRE>public static void <B>setDataContentHandlerFactory</B>(<A HREF="../../javax/activation/DataContentHandlerFactory.html" title="interface in javax.activation">DataContentHandlerFactory</A>&nbsp;newFactory)</PRE><DL><DD>Sets the DataContentHandlerFactory.  The DataContentHandlerFactory is called first to find DataContentHandlers. The DataContentHandlerFactory can only be set once. <p> If the DataContentHandlerFactory has already been set, this method throws an Error.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newFactory</CODE> - the DataContentHandlerFactory<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Error.html" title="class or interface in java.lang">Error</A></CODE> - if the factory has already been defined.<DT><B>See Also:</B><DD><A HREF="../../javax/activation/DataContentHandlerFactory.html" title="interface in javax.activation"><CODE>DataContentHandlerFactory</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../javax/activation/DataContentHandlerFactory.html" title="interface in javax.activation"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../javax/activation/DataSource.html" title="interface in javax.activation"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html?javax/activation/DataHandler.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="DataHandler.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -