org.knime.core.node.port
Class PortObject.PortObjectSerializer<T extends PortObject>

java.lang.Object
  extended by org.knime.core.node.port.PortObject.PortObjectSerializer<T>
Type Parameters:
T - class of the object to save or load.
All Implemented Interfaces:
SerializerMethodLoader.Serializer<T>
Direct Known Subclasses:
PMMLPortObjectSerializer
Enclosing interface:
PortObject

public abstract static class PortObject.PortObjectSerializer<T extends PortObject>
extends Object
implements SerializerMethodLoader.Serializer<T>

Factory class that's used for writing and loading objects of class denoted by T. See description of class PortObject for details.


Constructor Summary
PortObject.PortObjectSerializer()
           
 
Method Summary
abstract  T loadPortObject(PortObjectZipInputStream in, PortObjectSpec spec, ExecutionMonitor exec)
          Load a portObject from an input stream.
abstract  void savePortObject(T portObject, PortObjectZipOutputStream out, ExecutionMonitor exec)
          Saves the portObject to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortObject.PortObjectSerializer

public PortObject.PortObjectSerializer()
Method Detail

savePortObject

public abstract void savePortObject(T portObject,
                                    PortObjectZipOutputStream out,
                                    ExecutionMonitor exec)
                             throws IOException,
                                    CanceledExecutionException
Saves the portObject to an output stream. There is no need to also save the PortObjectSpec associated with the port object as the framework will save both in different places and will provide the spec when PortObjectZipInputStream, PortObjectSpec, ExecutionMonitor) is called.

Parameters:
portObject - The object to save.
out - Where to save to
exec - To report progress to and to check for cancelation.
Throws:
IOException - If that fails for IO problems.
CanceledExecutionException - If canceled.

loadPortObject

public abstract T loadPortObject(PortObjectZipInputStream in,
                                 PortObjectSpec spec,
                                 ExecutionMonitor exec)
                                             throws IOException,
                                                    CanceledExecutionException
Load a portObject from an input stream.

Parameters:
in - Where to load from
spec - The spec that was associated with the object. It can safely be cast to the expected PortObjectSpec class.
exec - To report progress to and to check for cancelation.
Returns:
The restored object.
Throws:
IOException - If that fails for IO problems.
CanceledExecutionException - If canceled.


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.