JavaTM 2 Platform
Std. Ed. v1.3.1

com.apple.mrj.datatransfer
Class TranslationSet

java.lang.Object
  |
  +--com.apple.mrj.datatransfer.TranslationSet
All Implemented Interfaces:
Translator

Deprecated. As of MacOSX 10.2

public class TranslationSet
extends Object
implements Translator

A Translator that delegates to a collection of registered Translators. It is actually just a container for multiple Translators that do the work; the Translators are registered with it, and it dispatches to the correct one.

The most common way to use this class is implicitly, by instantiating a TranslatedTransferable object to wrap around the Transferable object that needs translation.

See Also:
Translation, Translator, TranslatedTransferable

Field Summary
static TranslationSet standard
          Deprecated. The standard TranslationSet used by the system.
 
Constructor Summary
TranslationSet()
          Deprecated.  
 
Method Summary
 void addTranslator(DataFlavor from, DataFlavor to, String translatorClass)
          Deprecated. Registers a Translator without having to intantiate it or even load the class.
 void addTranslator(Translator t)
          Deprecated. Registers a Translator object instance.
 Translation[] getTranslations()
          Deprecated. Returns an array of the Translations that this TranslationSet supports.
 DataFlavor[] getTranslationsFrom(DataFlavor[] source)
          Deprecated. Returns an array of all the unique DataFlavors into which the array of source DataFlavors can be translated.
 Object translate(Object data, Translation t)
          Deprecated. Performs a translation on a data item, whose class is expected to match the representationClass of the Translation's source flavor.
 Object translate(Transferable t, DataFlavor destination)
          Deprecated. Translates the data from a Transferable into the desired destination flavor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

standard

public static final TranslationSet standard
Deprecated. 
The standard TranslationSet used by the system. It's possible to instantiate your own TranslationSets, but there's not much point.
Constructor Detail

TranslationSet

public TranslationSet()
Deprecated. 
Method Detail

addTranslator

public void addTranslator(Translator t)
Deprecated. 
Registers a Translator object instance.

addTranslator

public void addTranslator(DataFlavor from,
                          DataFlavor to,
                          String translatorClass)
Deprecated. 
Registers a Translator without having to intantiate it or even load the class. The "from" and "to" flavors must be given since no instance is available to ask. This method should be called once for every distinct translation that this Translator can perform.

getTranslations

public Translation[] getTranslations()
Deprecated. 
Returns an array of the Translations that this TranslationSet supports.
Specified by:
getTranslations in interface Translator

getTranslationsFrom

public DataFlavor[] getTranslationsFrom(DataFlavor[] source)
Deprecated. 
Returns an array of all the unique DataFlavors into which the array of source DataFlavors can be translated.

translate

public Object translate(Object data,
                        Translation t)
                 throws UnsupportedFlavorException,
                        IOException
Deprecated. 
Performs a translation on a data item, whose class is expected to match the representationClass of the Translation's source flavor.
Specified by:
translate in interface Translator
Throws:
UnsupportedFlavorException - if this is not a Translation I support
IOException - If an I/O exception occurs while translating the data

translate

public Object translate(Transferable t,
                        DataFlavor destination)
                 throws UnsupportedFlavorException,
                        IOException
Deprecated. 
Translates the data from a Transferable into the desired destination flavor.
Throws:
UnsupportedFlavorException - if no appropriate translation could be found.
IOException - If an I/O exception occurred while translating the data

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.