de.grogra.pf.io
Class IOFlavor

java.lang.Object
  extended by de.grogra.pf.io.IOFlavor

public final class IOFlavor
extends java.lang.Object

An IOFlavor is similar to a DataFlavor: For some data to be transfered in an IO operation, it describes both the type of data and the way how to transfer it. The type is specified by a MimeType, the possible ways for transfer by a combination of those bit masks which are defined in this class.

Author:
Ole Kniemeyer

Field Summary
static int DOM
          Bit mask indicating that the data can be obtained as a DOM tree.
static int FILE_OUT
           
static int FILE_READER
          Bit mask indicating that the data can be obtained from a File.
static int FILE_WRITER
          Bit mask indicating that the data can be written to a File.
static IOFlavor FS_FLAVOR
           
static IOFlavor GRAPH_LOADER
           
static int INPUT_STREAM
          Bit mask indicating that the data can be obtained from an InputStream.
static IOFlavor INVALID
           
static IOFlavor NODE
           
static int OBJECT
          Bit mask indicating that the data can be obtained immediately as an Object.
static int OUTPUT_STREAM
          Bit mask indicating that the data can be written to an OutputStream.
static IOFlavor PROJECT_LOADER
           
static int READER
          Bit mask indicating that the data can be obtained from a Reader.
static IOFlavor REGISTRY
           
static IOFlavor REGISTRY_LOADER
           
static IOFlavor RESOURCE_LOADER
           
static int SAX
          Bit mask indicating that the data can be obtained as a series of SAX events.
static IOFlavor SCI_FLAVOR
          The IOFlavor type SCI_FLAVOR indicates greenscilab files
static int TRANSFER_IO_STREAM
           
static int TRANSFER_STREAM
           
static int TRANSFER_TYPES
           
static int VFILE_READER
          Bit mask indicating that the data can be obtained from a virtual file.
static int VFILE_WRITER
          Bit mask indicating that the data can be written to a virtual file.
static int WRITER
          Bit mask indicating that the data can be written to a Writer.
static IOFlavor XML_FLAVOR
           
 
Constructor Summary
IOFlavor(MimeType javaMimeType)
           
IOFlavor(MimeType mimeType, int features, java.lang.Class objectClass)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 MimeType getMimeType()
           
 java.lang.Class getObjectClass()
           
 int hashCode()
           
 boolean isAssignableFrom(IOFlavor f)
           
 boolean isDOMSupported()
           
 boolean isFileReaderSupported()
           
 boolean isFileWriterSupported()
           
 boolean isInputStreamSupported()
           
 boolean isObjectSupported()
           
 boolean isOutputStreamSupported()
           
 boolean isReaderSupported()
           
 boolean isSAXSupported()
           
 boolean isVirtualFileReaderSupported()
           
 boolean isVirtualFileWriterSupported()
           
 boolean isWritableTo(IOFlavor dest)
           
 boolean isWritableTo(MimeType dest)
           
 boolean isWriterSupported()
           
 java.lang.String toString()
           
static IOFlavor valueOf(java.lang.Class cls)
           
static IOFlavor valueOf(MimeType t)
           
static IOFlavor valueOf(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DOM

public static final int DOM
Bit mask indicating that the data can be obtained as a DOM tree. The source which provides the data has to implement DOMSource.

See Also:
Constant Field Values

FILE_OUT

public static final int FILE_OUT
See Also:
Constant Field Values

FILE_READER

public static final int FILE_READER
Bit mask indicating that the data can be obtained from a File. The source which provides the data has to implement FileReaderSource.

See Also:
Constant Field Values

FILE_WRITER

public static final int FILE_WRITER
Bit mask indicating that the data can be written to a File. The source which provides the data has to implement FileWriterSource.

See Also:
Constant Field Values

FS_FLAVOR

public static final IOFlavor FS_FLAVOR

GRAPH_LOADER

public static final IOFlavor GRAPH_LOADER

INPUT_STREAM

public static final int INPUT_STREAM
Bit mask indicating that the data can be obtained from an InputStream. The source which provides the data has to implement InputStreamSource.

See Also:
Constant Field Values

INVALID

public static final IOFlavor INVALID

NODE

public static final IOFlavor NODE

OBJECT

public static final int OBJECT
Bit mask indicating that the data can be obtained immediately as an Object. The source which provides the data has to implement ObjectSource.

See Also:
Constant Field Values

OUTPUT_STREAM

public static final int OUTPUT_STREAM
Bit mask indicating that the data can be written to an OutputStream. The source which provides the data has to implement OutputStreamSource.

See Also:
Constant Field Values

PROJECT_LOADER

public static final IOFlavor PROJECT_LOADER

READER

public static final int READER
Bit mask indicating that the data can be obtained from a Reader. The source which provides the data has to implement ReaderSource.

See Also:
Constant Field Values

REGISTRY

public static final IOFlavor REGISTRY

REGISTRY_LOADER

public static final IOFlavor REGISTRY_LOADER

RESOURCE_LOADER

public static final IOFlavor RESOURCE_LOADER

SAX

public static final int SAX
Bit mask indicating that the data can be obtained as a series of SAX events. The source which provides the data has to implement SAXSource.

See Also:
Constant Field Values

SCI_FLAVOR

public static final IOFlavor SCI_FLAVOR
The IOFlavor type SCI_FLAVOR indicates greenscilab files


TRANSFER_IO_STREAM

public static final int TRANSFER_IO_STREAM
See Also:
Constant Field Values

TRANSFER_STREAM

public static final int TRANSFER_STREAM
See Also:
Constant Field Values

TRANSFER_TYPES

public static final int TRANSFER_TYPES
See Also:
Constant Field Values

VFILE_READER

public static final int VFILE_READER
Bit mask indicating that the data can be obtained from a virtual file. The source which provides the data has to implement VirtualFileReaderSource.

See Also:
Constant Field Values

VFILE_WRITER

public static final int VFILE_WRITER
Bit mask indicating that the data can be written to a virtual file. The source which provides the data has to implement VirtualFileWriterSource.

See Also:
Constant Field Values

WRITER

public static final int WRITER
Bit mask indicating that the data can be written to a Writer. The source which provides the data has to implement WriterSource.

See Also:
Constant Field Values

XML_FLAVOR

public static final IOFlavor XML_FLAVOR
Constructor Detail

IOFlavor

public IOFlavor(MimeType javaMimeType)

IOFlavor

public IOFlavor(MimeType mimeType,
                int features,
                java.lang.Class objectClass)
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getMimeType

public MimeType getMimeType()

getObjectClass

public java.lang.Class getObjectClass()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isAssignableFrom

public boolean isAssignableFrom(IOFlavor f)

isDOMSupported

public boolean isDOMSupported()

isFileReaderSupported

public boolean isFileReaderSupported()

isFileWriterSupported

public boolean isFileWriterSupported()

isInputStreamSupported

public boolean isInputStreamSupported()

isObjectSupported

public boolean isObjectSupported()

isOutputStreamSupported

public boolean isOutputStreamSupported()

isReaderSupported

public boolean isReaderSupported()

isSAXSupported

public boolean isSAXSupported()

isVirtualFileReaderSupported

public boolean isVirtualFileReaderSupported()

isVirtualFileWriterSupported

public boolean isVirtualFileWriterSupported()

isWritableTo

public boolean isWritableTo(IOFlavor dest)

isWritableTo

public boolean isWritableTo(MimeType dest)

isWriterSupported

public boolean isWriterSupported()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

valueOf

public static IOFlavor valueOf(java.lang.Class cls)

valueOf

public static IOFlavor valueOf(MimeType t)

valueOf

public static IOFlavor valueOf(java.lang.String s)