📄 datacontenthandler.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Jan 17 03:51:30 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Interface DataContentHandler
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/activation/CommandObject.html"><B>PREV CLASS</B></A>
<A HREF="../../javax/activation/DataContentHandlerFactory.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="DataContentHandler.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.activation</FONT>
<BR>
Interface DataContentHandler</H2>
<HR>
<DL>
<DT>public interface <B>DataContentHandler</B></DL>
<P>
The DataContentHandler interface is implemented by objects that can
be used to extend the capabilities of the DataHandler's implementation
of the Transferable interface. Through <code>DataContentHandlers</code>
the framework can be extended to convert streams in to objects, and
to write objects to streams. <p>
Applications don't generally call the methods in DataContentHandlers
directly. Instead, an application calls the equivalent methods in
DataHandler. The DataHandler will attempt to find an appropriate
DataContentHandler that corresponds to its MIME type using the
current DataContentHandlerFactory. The DataHandler then calls
through to the methods in the DataContentHandler.
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/activation/DataContentHandler.html#getContent(javax.activation.DataSource)">getContent</A></B>(<A HREF="../../javax/activation/DataSource.html">DataSource</A> ds)</CODE>
<BR>
Return an object representing the data in its most preferred form.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/activation/DataContentHandler.html#getTransferData(java.awt.datatransfer.DataFlavor, javax.activation.DataSource)">getTransferData</A></B>(java.awt.datatransfer.DataFlavor df,
<A HREF="../../javax/activation/DataSource.html">DataSource</A> ds)</CODE>
<BR>
Returns an object which represents the data to be transferred.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.awt.datatransfer.DataFlavor[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/activation/DataContentHandler.html#getTransferDataFlavors()">getTransferDataFlavors</A></B>()</CODE>
<BR>
Returns an array of DataFlavor objects indicating the flavors the
data can be provided in.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/activation/DataContentHandler.html#writeTo(java.lang.Object, java.lang.String, java.io.OutputStream)">writeTo</A></B>(java.lang.Object obj,
java.lang.String mimeType,
java.io.OutputStream os)</CODE>
<BR>
Convert the object to a byte stream of the specified MIME type
and write it to the output stream.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getTransferDataFlavors()"><!-- --></A><H3>
getTransferDataFlavors</H3>
<PRE>
public java.awt.datatransfer.DataFlavor[] <B>getTransferDataFlavors</B>()</PRE>
<DL>
<DD>Returns an array of DataFlavor objects indicating the flavors the
data can be provided in. The array should be ordered according to
preference for providing the data (from most richly descriptive to
least descriptive).<DD><DL>
<DT><B>Returns:</B><DD>The DataFlavors.</DL>
</DD>
</DL>
<HR>
<A NAME="getTransferData(java.awt.datatransfer.DataFlavor, javax.activation.DataSource)"><!-- --></A><H3>
getTransferData</H3>
<PRE>
public java.lang.Object <B>getTransferData</B>(java.awt.datatransfer.DataFlavor df,
<A HREF="../../javax/activation/DataSource.html">DataSource</A> ds)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException</PRE>
<DL>
<DD>Returns an object which represents the data to be transferred.
The class of the object returned is defined by the representation class
of the flavor.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>df</CODE> - The DataFlavor representing the requested type.<DD><CODE>ds</CODE> - The DataSource representing the data to be converted.<DT><B>Returns:</B><DD>The constructed Object.</DL>
</DD>
</DL>
<HR>
<A NAME="getContent(javax.activation.DataSource)"><!-- --></A><H3>
getContent</H3>
<PRE>
public java.lang.Object <B>getContent</B>(<A HREF="../../javax/activation/DataSource.html">DataSource</A> ds)
throws java.io.IOException</PRE>
<DL>
<DD>Return an object representing the data in its most preferred form.
Generally this will be the form described by the first DataFlavor
returned by the <code>getTransferDataFlavors</code> method.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>ds</CODE> - The DataSource representing the data to be converted.<DT><B>Returns:</B><DD>The constructed Object.</DL>
</DD>
</DL>
<HR>
<A NAME="writeTo(java.lang.Object, java.lang.String, java.io.OutputStream)"><!-- --></A><H3>
writeTo</H3>
<PRE>
public void <B>writeTo</B>(java.lang.Object obj,
java.lang.String mimeType,
java.io.OutputStream os)
throws java.io.IOException</PRE>
<DL>
<DD>Convert the object to a byte stream of the specified MIME type
and write it to the output stream.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - The object to be converted.<DD><CODE>mimeType</CODE> - The requested MIME type of the resulting byte stream.<DD><CODE>os</CODE> - The output stream into which to write the converted
byte stream.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/activation/CommandObject.html"><B>PREV CLASS</B></A>
<A HREF="../../javax/activation/DataContentHandlerFactory.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="DataContentHandler.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -