org.knime.core.node.port
Class PortUtil

java.lang.Object
  extended by org.knime.core.node.port.PortUtil

public final class PortUtil
extends Object

Contains framework methods that are used to persist or read PortObject and PortObjectSpec objects.

Methods in this class are not meant to be used by node developers. This class and its methods may change in future versions.

Author:
Bernd Wiswedel, University of Konstanz

Method Summary
static
<T extends PortObject>
PortObject.PortObjectSerializer<T>
getPortObjectSerializer(Class<T> cl)
          Get the globally used serializer for PortObject objects represented by the class argument.
static
<T extends PortObjectSpec>
PortObjectSpec.PortObjectSpecSerializer<T>
getPortObjectSpecSerializer(Class<T> cl)
          Get the globally used serializer for PortObjectSpec objects represented by the class argument.
static PortObjectSpecZipInputStream getPortObjectSpecZipInputStream(InputStream in)
           
static PortObjectSpecZipOutputStream getPortObjectSpecZipOutputStream(OutputStream in)
           
static PortObjectZipInputStream getPortObjectZipInputStream(InputStream in)
           
static PortObjectZipOutputStream getPortObjectZipOutputStream(OutputStream in)
           
static PortObject readObjectFromFile(File file, ExecutionMonitor exec)
           
static PortObjectSpec readObjectSpecFromFile(File file)
           
static void writeObjectToFile(PortObject po, File file, ExecutionMonitor exec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPortObjectSpecSerializer

public static <T extends PortObjectSpec> PortObjectSpec.PortObjectSpecSerializer<T> getPortObjectSpecSerializer(Class<T> cl)
Get the globally used serializer for PortObjectSpec objects represented by the class argument.

Type Parameters:
T - The specific PortObjectSpec class of interest.
Parameters:
cl - Class argument.
Returns:
The serializer to be used. Will throw an undeclared runtime exception if retrieving the type causes problems (suggests a coding problem)

getPortObjectSerializer

public static <T extends PortObject> PortObject.PortObjectSerializer<T> getPortObjectSerializer(Class<T> cl)
Get the globally used serializer for PortObject objects represented by the class argument.

Type Parameters:
T - The specific PortObject class of interest.
Parameters:
cl - Class argument.
Returns:
The serializer to be used. Will throw an undeclared runtime exception if retrieving the type causes problems (suggests a coding problem)

getPortObjectSpecZipOutputStream

public static PortObjectSpecZipOutputStream getPortObjectSpecZipOutputStream(OutputStream in)
                                                                      throws IOException
Throws:
IOException

getPortObjectZipOutputStream

public static PortObjectZipOutputStream getPortObjectZipOutputStream(OutputStream in)
                                                              throws IOException
Throws:
IOException

getPortObjectSpecZipInputStream

public static PortObjectSpecZipInputStream getPortObjectSpecZipInputStream(InputStream in)
                                                                    throws IOException
Throws:
IOException

getPortObjectZipInputStream

public static PortObjectZipInputStream getPortObjectZipInputStream(InputStream in)
                                                            throws IOException
Throws:
IOException

writeObjectToFile

public static void writeObjectToFile(PortObject po,
                                     File file,
                                     ExecutionMonitor exec)
                              throws IOException,
                                     CanceledExecutionException
Throws:
IOException
CanceledExecutionException

readObjectFromFile

public static PortObject readObjectFromFile(File file,
                                            ExecutionMonitor exec)
                                     throws IOException,
                                            CanceledExecutionException
Throws:
IOException
CanceledExecutionException

readObjectSpecFromFile

public static PortObjectSpec readObjectSpecFromFile(File file)
                                             throws IOException
Throws:
IOException


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.