Class Serializer
- java.lang.Object
-
- de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
-
- de.uni_trier.wi2.procake.data.io.IOImpl
-
- de.uni_trier.wi2.procake.data.io.ser.Serializer
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAMEConstantNAME="Serializer"-
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.IO
COMPONENT, COMPONENT_KEY, DEFAULT_ENCODING, LOG_CONTENTHANDLER_NOT_FOUND, LOG_FILE_NOT_FOUND, LOG_IO_EXCEPTION, LOG_READER_NOT_FOUND, LOG_SAX_EXCEPTION, LOG_UNKNOWN_PARAMETER, LOG_WRITER_NOT_FOUND, LOG_WRONG_PARAMATER_TYPE, RESOURCE_XML
-
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.Writer
COMPONENT, COMPONENT_KEY, LOG_CANNOT_WRITE, LOG_NO_WRITER_FOUND, LOG_UNEXPECTED_IOEXCEPTION
-
-
Constructor Summary
Constructors Constructor Description Serializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IOcopy()overwritten copy-method from Object; use it to copy a complete operatorStringgetName()Each io component must have a name that is used inIOFactory.newIO(String).booleanisHandlerFor(Class value)Checks if the io component is capable to perform the operation for objects of this class.voidsetFilename(String filename)Each writer must be able to write a file to the local filesytem.voidsetOutputStream(OutputStream output)Each writer must be able to store the object into an OutputStream.voidstore(Object value)The store command writes the given value.-
Methods inherited from class de.uni_trier.wi2.procake.data.io.IOImpl
getDescription, getFamily, getParameters, postInit, preInit, setFamily
-
Methods inherited from class de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
getParameter, initParametersBasedOn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.uni_trier.wi2.procake.utils.io.IO
getDescription, getFamily, setFamily
-
-
-
-
Field Detail
-
NAME
public static final String NAME
ConstantNAME="Serializer"- See Also:
- Constant Field Values
-
-
Method Detail
-
setFilename
public void setFilename(String filename)
Each writer must be able to write a file to the local filesytem. The filename should be an absolute path.- Specified by:
setFilenamein interfaceWriter- Parameters:
filename- The filename into which the object should be stored.
-
setOutputStream
public void setOutputStream(OutputStream output)
Each writer must be able to store the object into an OutputStream.- Specified by:
setOutputStreamin interfaceWriter- Parameters:
output- TheOutputStreaminto that the object should be stored.
-
store
public void store(Object value) throws CakeIOException
The store command writes the given value.- Specified by:
storein interfaceWriter- Parameters:
value- The object that should be stored- Throws:
CakeIOException
-
getName
public String getName()
Each io component must have a name that is used inIOFactory.newIO(String). The name must be unique thus it is usefull to use a short description or to the class name (this.getClass().getName()).
-
isHandlerFor
public boolean isHandlerFor(Class value)
Checks if the io component is capable to perform the operation for objects of this class.A typical implementation looks like:
public boolean isHandlerFor(Class value) { if (DataObject.class.isAssignableFrom(value)) return true; return false; }- Specified by:
isHandlerForin interfaceIO- Parameters:
value- The class that has to be checked.- Returns:
- Results
trueif the class can oeprate with the given class.
-
-