-
Enhancement
-
Resolution: Won't Fix
-
P3
-
None
-
1.3.0
-
None
-
sparc
-
solaris_2.6
utStreamWriter
*/
public String getCharToByteEncodingForCharset(String charset) {}
/**
* Returns the default charset for MIME types that do not specify
* the charset parameter explicitly. This value is platform-
* dependent.
*/
public String getDefaultCharset() {}
} // class TextFlavor
/**
* A class to encapsulate MimeType parsing related exceptions
*/
package java.awt.datatransfer;
public class MimeTypeParseException extends Exception {
/**
* Constructs a MimeTypeParseException with no specified detail message.
*/
public MimeTypeParseException() { }
/**
* Constructs a MimeTypeParseException with the specified detail message.
*
* @param message the detail message.
*/
public MimeTypeParseException(String message) {}
} // class MimeTypeParseException
*********************************************************************
*********************************************************************
***** *****
***** *****
***** METHODS ADDED TO EXISTING CLASSES *****
***** *****
***** *****
*********************************************************************
*********************************************************************
/**
* Gets the default registry for the toolkit
*/
DataFlavorRegistry Toolkit.getDefaultDataFlavorRegistry();
/**
* Gets an input stream reader, using the proper text decoding.
* This method only works properly for text data transfer.
* If the data being transfered is binary data and not text,
* use <code>getTransferData()</code> to get the raw InputStream,
* instead.
*
* @throws ClassCastException if the transferred object is anything
* but an InputStream
*
* @see #getTransferData(DataFlavor)
*/
InputStreamReader Transferable.getInputStreamReader(DataFlavor flavor);
/**
* Gets the default representation class, which is always
* java.io.InputStream.
*
* @returns java.io.InputStream
*/
public static final Class DataFlavor.getDefaultRepresentationClass() {}
/**
* Gets the default representation class name, which is always
* <code>"java.io.InputStream"</code>.
*
* @returns <code>"java.io.InputStream"</code>"
*/
public static final Class DataFlavor.getDefaultRepresentationClassName() {}
==============================================================================
==============================================================================
jethro 6May99
Document: Proposed Drag & Drop API enhncements for JDK1.3
Revision: 3 May, 1999; ###@###.###
-------------------------------------------------------------------------
DESIGN GOALS AND RATIONALE
There two primary design goals for the Kestrel drag and
drop enhancements:
1. Make selecting of text flavors and encodings much simpler
and more automatic.
2. Make InputStream text decoding automatic.
And of course:
0. Maintain backwards compatibility
My belief is that the existing methods are sufficient to provide
fine control for applications that want it, so only higher-level
APIs are going into this release.
Currently, the text mime flavors are represented using the
base class DataFlavor. Unfortunately, DataFlavor does not
distinguish between text encodings, so these types are all
considered equal [via the equals() method].
text/plain; charset=ascii
text/plain; charset=iso8859-1
text/plain; charset=unicode
Clearly these types are not all compatible, and often
applications will think they've selected one type of data
stream, and they get something different. This causes
exceptions to be thrown or the resulting text to be
badly garbled. This proposal solves this problem.
However, one open issue is whether to allow application code
to override the default DataFlavors. For instance, should an
application be able to define a DataFlavor subclass and register
it to handle "text/plain; charset=iso8859-1?" If it does, all code
running in the VM will now use that DataFlavor when dealing with
that MIME type.
-------------------------------------------------------------------------
ARCHITECTURAL OVERVIEW
A TextFlavor class is added and is a subclass of DataFlavor.
This class is aware of text encodings. The primary advantage
is the ability to override equals() to correctly discriminate
between encodings.
A DataFlavorRegistry class is added, which allows
easy addition of new DataFlavors by applications, and also
by internal JDK developers. It's important that all pieces
of code using the same MIME type be using the same DataFlavor
subclass, so a central registry is necessary for applications
that want to define their own DataFlavor subclasses.
A method getInputStreamReader() is added to the Transferable
class. This way, encodings can be handled automatically.
*********************************************************************
*********************************************************************
***** *****
***** *****
***** DEPRECATED SYMBOLS *****
***** *****
***** *****
*********************************************************************
*********************************************************************
DataFlavor DataFlavor.stringFlavor;
DataFlavor DataFlavor.plainTextFlavor;
String javaJVMLocalObjectMimeType
String javaRemoteObjectMimeType
String javaSerializeObjectMimeType
These will be deprecated because stringFlavor and plainTextFlavor
will become instances of TextFlavor, which is a subclass of
DataFlavor. Having class static variables which are subclass
instances is difficult to initialize, and maintenance is also
a problem, since more subclasses are likely to be added. This
functionality is moved to the new DataFlavorRegistry class.
The String MIME types will be replaced with DataFlavor objects
available from the DataFlavorRegistry. This reduces confusion
by consistently using DataFlavor objects, rather than a
combination of DataFlavors and String MIME types.
*********************************************************************
*********************************************************************
***** *****
***** *****
***** NEW PUBLIC CLASSES *****
***** *****
***** *****
*********************************************************************
*********************************************************************
package java.awt.datatransfer;
public class DataFlavorRegistry extends Object {
protected String fileListMimeTypeString =
"x-application/x-java-file-list;class=java.util.List";
protected String stringMimeTypeString =
"x-application/java-serialized-object; charset=unicode; class=java.lang.String";
protected String textPlainAsciiMimeTypeString =
"text/plain; charset=ascii";
protected String textPlainUSAsciiMimeTypeString =
"text/plain; charset=us-ascii";
protected String textPlainUnicodeMimeTypeString =
"text/plain; charset=unicode";
protected String textPlainISO8859_1MimeTypeString =
"text/plain; charset=iso8859-1";
/**
* Creates a DataFlavorRegistry with a set of predefined types.
*/
public DataFlavorRegistry() {}
/**
* Called by the constructor. This can be overridden by subclasses
* to change or augment the set of predefined flavors.
*/
protected void registerPredefinedFlavors() {}
/**
* gets the DataFlavor used to transfer a list of files. The
* representation class is always java.util.List, and each
* element is always of type java.io.File. However, the MIME
* type may be platform-dependent.
*/
public DataFlavor getFileListFlavor() { }
/**
* Gets the DataFlavor for transferring a java unicode String object.
*/
public DataFlavor getStringObjectFlavor() { }
/**
* Returns the DataFlavor for MIME type
* <code>text/plain; charset=ascii; class=java.io.InputStream</code>
*/
public DataFlavor getTextPlainAsciiFlavor() { }
/**
* Returns the DataFlavor for MIME type
* <code>text/plain; charset=iso8859-1; class=java.io.InputStream</code>
*/
public DataFlavor getTextPlainISO8859_1Flavor() { }
/**
* Returns the DataFlavor for MIME type
* <code>text/plain; charset=unicode; class=java.io.InputStream</code>
*/
public DataFlavor getTextPlainUnicodeFlavor() { }
/**
* Registers a DataFlavor subclass to represent the given
* MIME type. Only the MIME type and subtype are inspected,
* and any parameters are ignored during registration.
* <p>
* The primary MIME type must be provided, but the subtype may
* be ommitted. For instance, some valid types are <code>text</code>,
* <code>text/plain</code>, and <code>image/gif</code>. If a
* flavor is already registered for this type/subtype, that
* flavor is unregistered.
* </p>
* <p>
* When doing a lookup, the most factory registered for the most
* specific type is used.
* </p>
*
* @throws IllegalArgumentException if the mimeType is empty
* @see #getFlavorForMimeType
*
*/
public void registerFlavorClass(String mimeType, String flavorClassName)
throws MimeTypeParseException {}
/**
* Unregisters this DataFlavor class for all MIME types.
* If necessary, the class name of a loaded class can be
* found by using <code>flavor.getClass().getName()</code>. The
* <code>datatransfer</code> package prefers String class
* names, rather than class objects in order to avoid
* unnecessarily loading classes.
*/
public void unregisterFlavorClass(String flavorClassName) {}
/**
* unregisters the flavor class for one mime type or type/subtype.
* Note that a wildcard only removes the registration for one
* entry, and other matching entries are not unregistered. For
* example, unregistering <code>text/*</code> will not unregister
* <code>text/plain</code> or <code>text/html</code>.
*/
public void unregisterMimeType(String mimeTypeString)
throws MimeTypeParseException {}
/**
* Gets the list of all registered flavors.
*/
public String[] getRegisteredMimeTypes() {}
/**
* Gets a DataFlavor object that represents this MIME type. If the
* representation class cannot be loaded for any reason, a
* <code>ClassNotFoundException</code> is thrown (even if the class actually
* exists). Look at the message in the exception (via
* <code>getMessage()</code> to determine the reason for the
* failure.
*
* @throws MimeTypeParseException if mimeTypeString is improperly formatted
* @throws ClassNotFoundException if the representation class cannot
* be loaded for any reason.
*/
public DataFlavor getFlavorForMimeType(String mimeTypeString)
throws MimeTypeParseException, ClassNotFoundException {}
} // class DataFlavorRegistry
package java.awt.datatransfer;
public class TextFlavor extends DataFlavor {
/**
* Creates a TextFlavor object that represents the given MIME
* type. The MIME type must be of primary type <code>text</code>. If the
* <code>charset</code> parameter is not specified, the default (via
* <code>getDefaultCharset()</code) is assumed. If the <code>class</code>
* parameter is not specified, the default (via
* <code>getDefaultRepresentationClass()</code>) is assumed.
*
* @param mimeType The MIME type this TextFlavor represents
*
* @throws IllegalArgumentException if the mimeType primary type
* is not <code>text</code>
*/
public TextFlavor(String mimeTypeString) throws ClassNotFoundException {}
/**
* Create a clone of this object
*/
public Object clone() throws CloneNotSupportedException {}
/**
* Two TextFlavors are equal if their MIME type, subtype,
* charset, and representation class are equal. If a MIME
* type does not specify the <code>charset</code> parameter, the default
* (via <code>getDefaultCharset()</code>) is assumed. If
* the MIME type does not specify the <code>class</code>
* parameter, <code>java.io.InputStream</code> is assumed.
*/
public boolean equals(Object that) {}
/**
* Two TextFlavors are equal if their MIME type, subtype,
* charset, and representation class are equal. If a MIME
* type does not specify the <code>charset</code> parameter, the default
* (via <code>getDefaultCharset()</code>) is assumed. If
* the MIME type does not specify the <code>class</code>
* parameter, <code>java.io.InputStream</code> is assumed.
*/
public boolean equals(DataFlavor that) {}
/**
* Returns true if the MIME type is equal to the MIME type for
* this <code>TextFlavor</code>. The types are considered equal
* if the primary type, subtype, and charset parameter are all
* equal. Representation class and parameters other than charset
* are ignored. No default values are assumed.
*
*/
public boolean equals(String mimeString) {}
/**
* Returns the encoding that can be used to convert this text from
* a stream of bytes to a stream of characters.
* If the representation class
* is <code>java.lang.String</code>, this always returns
* <code>Unicode</code>. For representation class
* <code>java.io.InputStream</code> or a subclass, the
* encoding depends upon the MIME type.
* <p>
* If the MIME type does not specify the charset parameter,
* the default (via <code>getDefaultCharset()</code>) is
* assumed.
* </p>
* @return The proper encoding to pass to an InputStreamReader
* to decode the charset for this flavor. Returns
* <code>null</code> if no encoding is available for
* the charset.
*/
public String getByteToCharEncoding() {}
/**
* Returns the encoding that can be used to convert this text from
* a stream or array of characters into a stream of bytes.
* If the representation class
* is <code>java.lang.String</code>, this always returns
* <code>Unicode</code>. For representation class
* <code>java.io.InputStream</code> or a subclass, the
* encoding depends upon the MIME type.
* <p>
* If the MIME type does not specify the charset parameter,
* the default (via <code>getDefaultCharset()</code>) is
* assumed.
* </p>
* @return The proper encoding to pass to io methods to
* encode the charset for this flavor. Returns
* <code>null</code> if no encoding is available for
* the charset.
*/
public String getCharToByteEncoding() {}
/**
* Returns the charset parameter for this DataFlavor's MIME
* type. If the MIME type specifies the charset, then this
* method is identical to <code>getParameter("charset")</code>.
* If no charset is explicitly specified in the MIME type,
* this method returns the value of
* <code>getDefaultCharset()</code>.
*/
public String getCharset() {}
/**
* Gets the name of the encoding that can be used to interpret a
* stream or
* array of bytes encoded using this TextFlavor's charset.
* For instance, <code>ISO8859_1</code> decoding
* <i>may</i> be used to interpret an <code>ascii</code>
* charset stream. The value returned can be passed in
* as a character encoding to other JDK classes, such as
* <code>java.io.InputStreamReader</code>.
* <p>
* The MIME specification requires that all MIME values
* be lower case. MIME types with upper-case values are
* in error and may yield unpredictable results.
* </p>
*
* @param charset The charset to be decoded. If charset is
* <code>null</code>, the value returned by
* <code>getDefaultCharset()</code> is used.
*
* @return the appropriate character encoding, or <code>null</code>
* if no decoder is available.
*
* @see java.io.InputStreamReader
*/
public String getByteToCharEncodingForCharset(String charset) {}
/**
* Gets the name of the encoding that can be used to encode a
* stream or array of <code>Characters</code> into a stream or array
* of bytes, encoded using this TextFlavor's charset.
* For instance, <code>ISO8859_1</code> encoding
* <i>may</i> be used to encode a stream of <code>ascii</code>
* <code>Characters</code>. The value returned can be passed in
* as a character encoding to other JDK classes, such as
* <code>java.io.OutputStreamWriter</code>.
* <p>
* The MIME specification requires that all MIME values
* be lower case. MIME types with upper-case values are
* in error and may yield unpredictable results.
* </p>
*
* @param charset The charset to be decoded. If charset is
* <code>null</code>, the value returned by
* <code>getDefaultCharset()</code> is used.
*
* @return the appropriate character encoding, or <code>null</code>
* if no decoder is available.
*
* @see java.io.Outp
*/
public String getCharToByteEncodingForCharset(String charset) {}
/**
* Returns the default charset for MIME types that do not specify
* the charset parameter explicitly. This value is platform-
* dependent.
*/
public String getDefaultCharset() {}
} // class TextFlavor
/**
* A class to encapsulate MimeType parsing related exceptions
*/
package java.awt.datatransfer;
public class MimeTypeParseException extends Exception {
/**
* Constructs a MimeTypeParseException with no specified detail message.
*/
public MimeTypeParseException() { }
/**
* Constructs a MimeTypeParseException with the specified detail message.
*
* @param message the detail message.
*/
public MimeTypeParseException(String message) {}
} // class MimeTypeParseException
*********************************************************************
*********************************************************************
***** *****
***** *****
***** METHODS ADDED TO EXISTING CLASSES *****
***** *****
***** *****
*********************************************************************
*********************************************************************
/**
* Gets the default registry for the toolkit
*/
DataFlavorRegistry Toolkit.getDefaultDataFlavorRegistry();
/**
* Gets an input stream reader, using the proper text decoding.
* This method only works properly for text data transfer.
* If the data being transfered is binary data and not text,
* use <code>getTransferData()</code> to get the raw InputStream,
* instead.
*
* @throws ClassCastException if the transferred object is anything
* but an InputStream
*
* @see #getTransferData(DataFlavor)
*/
InputStreamReader Transferable.getInputStreamReader(DataFlavor flavor);
/**
* Gets the default representation class, which is always
* java.io.InputStream.
*
* @returns java.io.InputStream
*/
public static final Class DataFlavor.getDefaultRepresentationClass() {}
/**
* Gets the default representation class name, which is always
* <code>"java.io.InputStream"</code>.
*
* @returns <code>"java.io.InputStream"</code>"
*/
public static final Class DataFlavor.getDefaultRepresentationClassName() {}
==============================================================================
==============================================================================
jethro 6May99
Document: Proposed Drag & Drop API enhncements for JDK1.3
Revision: 3 May, 1999; ###@###.###
-------------------------------------------------------------------------
DESIGN GOALS AND RATIONALE
There two primary design goals for the Kestrel drag and
drop enhancements:
1. Make selecting of text flavors and encodings much simpler
and more automatic.
2. Make InputStream text decoding automatic.
And of course:
0. Maintain backwards compatibility
My belief is that the existing methods are sufficient to provide
fine control for applications that want it, so only higher-level
APIs are going into this release.
Currently, the text mime flavors are represented using the
base class DataFlavor. Unfortunately, DataFlavor does not
distinguish between text encodings, so these types are all
considered equal [via the equals() method].
text/plain; charset=ascii
text/plain; charset=iso8859-1
text/plain; charset=unicode
Clearly these types are not all compatible, and often
applications will think they've selected one type of data
stream, and they get something different. This causes
exceptions to be thrown or the resulting text to be
badly garbled. This proposal solves this problem.
However, one open issue is whether to allow application code
to override the default DataFlavors. For instance, should an
application be able to define a DataFlavor subclass and register
it to handle "text/plain; charset=iso8859-1?" If it does, all code
running in the VM will now use that DataFlavor when dealing with
that MIME type.
-------------------------------------------------------------------------
ARCHITECTURAL OVERVIEW
A TextFlavor class is added and is a subclass of DataFlavor.
This class is aware of text encodings. The primary advantage
is the ability to override equals() to correctly discriminate
between encodings.
A DataFlavorRegistry class is added, which allows
easy addition of new DataFlavors by applications, and also
by internal JDK developers. It's important that all pieces
of code using the same MIME type be using the same DataFlavor
subclass, so a central registry is necessary for applications
that want to define their own DataFlavor subclasses.
A method getInputStreamReader() is added to the Transferable
class. This way, encodings can be handled automatically.
*********************************************************************
*********************************************************************
***** *****
***** *****
***** DEPRECATED SYMBOLS *****
***** *****
***** *****
*********************************************************************
*********************************************************************
DataFlavor DataFlavor.stringFlavor;
DataFlavor DataFlavor.plainTextFlavor;
String javaJVMLocalObjectMimeType
String javaRemoteObjectMimeType
String javaSerializeObjectMimeType
These will be deprecated because stringFlavor and plainTextFlavor
will become instances of TextFlavor, which is a subclass of
DataFlavor. Having class static variables which are subclass
instances is difficult to initialize, and maintenance is also
a problem, since more subclasses are likely to be added. This
functionality is moved to the new DataFlavorRegistry class.
The String MIME types will be replaced with DataFlavor objects
available from the DataFlavorRegistry. This reduces confusion
by consistently using DataFlavor objects, rather than a
combination of DataFlavors and String MIME types.
*********************************************************************
*********************************************************************
***** *****
***** *****
***** NEW PUBLIC CLASSES *****
***** *****
***** *****
*********************************************************************
*********************************************************************
package java.awt.datatransfer;
public class DataFlavorRegistry extends Object {
protected String fileListMimeTypeString =
"x-application/x-java-file-list;class=java.util.List";
protected String stringMimeTypeString =
"x-application/java-serialized-object; charset=unicode; class=java.lang.String";
protected String textPlainAsciiMimeTypeString =
"text/plain; charset=ascii";
protected String textPlainUSAsciiMimeTypeString =
"text/plain; charset=us-ascii";
protected String textPlainUnicodeMimeTypeString =
"text/plain; charset=unicode";
protected String textPlainISO8859_1MimeTypeString =
"text/plain; charset=iso8859-1";
/**
* Creates a DataFlavorRegistry with a set of predefined types.
*/
public DataFlavorRegistry() {}
/**
* Called by the constructor. This can be overridden by subclasses
* to change or augment the set of predefined flavors.
*/
protected void registerPredefinedFlavors() {}
/**
* gets the DataFlavor used to transfer a list of files. The
* representation class is always java.util.List, and each
* element is always of type java.io.File. However, the MIME
* type may be platform-dependent.
*/
public DataFlavor getFileListFlavor() { }
/**
* Gets the DataFlavor for transferring a java unicode String object.
*/
public DataFlavor getStringObjectFlavor() { }
/**
* Returns the DataFlavor for MIME type
* <code>text/plain; charset=ascii; class=java.io.InputStream</code>
*/
public DataFlavor getTextPlainAsciiFlavor() { }
/**
* Returns the DataFlavor for MIME type
* <code>text/plain; charset=iso8859-1; class=java.io.InputStream</code>
*/
public DataFlavor getTextPlainISO8859_1Flavor() { }
/**
* Returns the DataFlavor for MIME type
* <code>text/plain; charset=unicode; class=java.io.InputStream</code>
*/
public DataFlavor getTextPlainUnicodeFlavor() { }
/**
* Registers a DataFlavor subclass to represent the given
* MIME type. Only the MIME type and subtype are inspected,
* and any parameters are ignored during registration.
* <p>
* The primary MIME type must be provided, but the subtype may
* be ommitted. For instance, some valid types are <code>text</code>,
* <code>text/plain</code>, and <code>image/gif</code>. If a
* flavor is already registered for this type/subtype, that
* flavor is unregistered.
* </p>
* <p>
* When doing a lookup, the most factory registered for the most
* specific type is used.
* </p>
*
* @throws IllegalArgumentException if the mimeType is empty
* @see #getFlavorForMimeType
*
*/
public void registerFlavorClass(String mimeType, String flavorClassName)
throws MimeTypeParseException {}
/**
* Unregisters this DataFlavor class for all MIME types.
* If necessary, the class name of a loaded class can be
* found by using <code>flavor.getClass().getName()</code>. The
* <code>datatransfer</code> package prefers String class
* names, rather than class objects in order to avoid
* unnecessarily loading classes.
*/
public void unregisterFlavorClass(String flavorClassName) {}
/**
* unregisters the flavor class for one mime type or type/subtype.
* Note that a wildcard only removes the registration for one
* entry, and other matching entries are not unregistered. For
* example, unregistering <code>text/*</code> will not unregister
* <code>text/plain</code> or <code>text/html</code>.
*/
public void unregisterMimeType(String mimeTypeString)
throws MimeTypeParseException {}
/**
* Gets the list of all registered flavors.
*/
public String[] getRegisteredMimeTypes() {}
/**
* Gets a DataFlavor object that represents this MIME type. If the
* representation class cannot be loaded for any reason, a
* <code>ClassNotFoundException</code> is thrown (even if the class actually
* exists). Look at the message in the exception (via
* <code>getMessage()</code> to determine the reason for the
* failure.
*
* @throws MimeTypeParseException if mimeTypeString is improperly formatted
* @throws ClassNotFoundException if the representation class cannot
* be loaded for any reason.
*/
public DataFlavor getFlavorForMimeType(String mimeTypeString)
throws MimeTypeParseException, ClassNotFoundException {}
} // class DataFlavorRegistry
package java.awt.datatransfer;
public class TextFlavor extends DataFlavor {
/**
* Creates a TextFlavor object that represents the given MIME
* type. The MIME type must be of primary type <code>text</code>. If the
* <code>charset</code> parameter is not specified, the default (via
* <code>getDefaultCharset()</code) is assumed. If the <code>class</code>
* parameter is not specified, the default (via
* <code>getDefaultRepresentationClass()</code>) is assumed.
*
* @param mimeType The MIME type this TextFlavor represents
*
* @throws IllegalArgumentException if the mimeType primary type
* is not <code>text</code>
*/
public TextFlavor(String mimeTypeString) throws ClassNotFoundException {}
/**
* Create a clone of this object
*/
public Object clone() throws CloneNotSupportedException {}
/**
* Two TextFlavors are equal if their MIME type, subtype,
* charset, and representation class are equal. If a MIME
* type does not specify the <code>charset</code> parameter, the default
* (via <code>getDefaultCharset()</code>) is assumed. If
* the MIME type does not specify the <code>class</code>
* parameter, <code>java.io.InputStream</code> is assumed.
*/
public boolean equals(Object that) {}
/**
* Two TextFlavors are equal if their MIME type, subtype,
* charset, and representation class are equal. If a MIME
* type does not specify the <code>charset</code> parameter, the default
* (via <code>getDefaultCharset()</code>) is assumed. If
* the MIME type does not specify the <code>class</code>
* parameter, <code>java.io.InputStream</code> is assumed.
*/
public boolean equals(DataFlavor that) {}
/**
* Returns true if the MIME type is equal to the MIME type for
* this <code>TextFlavor</code>. The types are considered equal
* if the primary type, subtype, and charset parameter are all
* equal. Representation class and parameters other than charset
* are ignored. No default values are assumed.
*
*/
public boolean equals(String mimeString) {}
/**
* Returns the encoding that can be used to convert this text from
* a stream of bytes to a stream of characters.
* If the representation class
* is <code>java.lang.String</code>, this always returns
* <code>Unicode</code>. For representation class
* <code>java.io.InputStream</code> or a subclass, the
* encoding depends upon the MIME type.
* <p>
* If the MIME type does not specify the charset parameter,
* the default (via <code>getDefaultCharset()</code>) is
* assumed.
* </p>
* @return The proper encoding to pass to an InputStreamReader
* to decode the charset for this flavor. Returns
* <code>null</code> if no encoding is available for
* the charset.
*/
public String getByteToCharEncoding() {}
/**
* Returns the encoding that can be used to convert this text from
* a stream or array of characters into a stream of bytes.
* If the representation class
* is <code>java.lang.String</code>, this always returns
* <code>Unicode</code>. For representation class
* <code>java.io.InputStream</code> or a subclass, the
* encoding depends upon the MIME type.
* <p>
* If the MIME type does not specify the charset parameter,
* the default (via <code>getDefaultCharset()</code>) is
* assumed.
* </p>
* @return The proper encoding to pass to io methods to
* encode the charset for this flavor. Returns
* <code>null</code> if no encoding is available for
* the charset.
*/
public String getCharToByteEncoding() {}
/**
* Returns the charset parameter for this DataFlavor's MIME
* type. If the MIME type specifies the charset, then this
* method is identical to <code>getParameter("charset")</code>.
* If no charset is explicitly specified in the MIME type,
* this method returns the value of
* <code>getDefaultCharset()</code>.
*/
public String getCharset() {}
/**
* Gets the name of the encoding that can be used to interpret a
* stream or
* array of bytes encoded using this TextFlavor's charset.
* For instance, <code>ISO8859_1</code> decoding
* <i>may</i> be used to interpret an <code>ascii</code>
* charset stream. The value returned can be passed in
* as a character encoding to other JDK classes, such as
* <code>java.io.InputStreamReader</code>.
* <p>
* The MIME specification requires that all MIME values
* be lower case. MIME types with upper-case values are
* in error and may yield unpredictable results.
* </p>
*
* @param charset The charset to be decoded. If charset is
* <code>null</code>, the value returned by
* <code>getDefaultCharset()</code> is used.
*
* @return the appropriate character encoding, or <code>null</code>
* if no decoder is available.
*
* @see java.io.InputStreamReader
*/
public String getByteToCharEncodingForCharset(String charset) {}
/**
* Gets the name of the encoding that can be used to encode a
* stream or array of <code>Characters</code> into a stream or array
* of bytes, encoded using this TextFlavor's charset.
* For instance, <code>ISO8859_1</code> encoding
* <i>may</i> be used to encode a stream of <code>ascii</code>
* <code>Characters</code>. The value returned can be passed in
* as a character encoding to other JDK classes, such as
* <code>java.io.OutputStreamWriter</code>.
* <p>
* The MIME specification requires that all MIME values
* be lower case. MIME types with upper-case values are
* in error and may yield unpredictable results.
* </p>
*
* @param charset The charset to be decoded. If charset is
* <code>null</code>, the value returned by
* <code>getDefaultCharset()</code> is used.
*
* @return the appropriate character encoding, or <code>null</code>
* if no decoder is available.
*
* @see java.io.Outp