Class WorkflowWriter
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.xml.xerces_writerImpl.AbstractXMLWriter
de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.WorkflowWriter
- All Implemented Interfaces:
WorkflowTags
,IO
,ProCAKEWriter
This class serializes CAKE1-Workflows.
- Author:
- Alexander Stromer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ConstantWRITERNAME="XercesSaxWorkflowWriter"
Fields inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.AbstractXMLWriter
filename, outputStream
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.IO
DEFAULT_ENCODING, LOG_FILE_NOT_FOUND, LOG_IO_EXCEPTION, LOG_READER_NOT_FOUND, LOG_SAX_EXCEPTION, LOG_UNKNOWN_PARAMETER, LOG_WRONG_PARAMATER_TYPE, RESOURCE_XML
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.ProCAKEWriter
LOG_CANNOT_WRITE
Fields inherited from interface de.uni_trier.wi2.procake.data.io.xml.WorkflowTags
ATT_REASONING_NODE_AND, ATT_REASONING_NODE_LOOP, ATT_REASONING_NODE_XOR, ATT_REASONING_REFID, ATT_REASONING_STATUS, ATT_REASONING_TYPE, PREFIX_RWFL, SCHEMA_LOCATION_RWFL, TAG_REASONING_DATAFLOW_ELEMENT, TAG_REASONING_DATAOBJECT_CHILDS, TAG_REASONING_DATAOBJECT_REF, TAG_REASONING_DATAOBJECTS, TAG_REASONING_DATAOBJECTWRAPPER, TAG_REASONING_NODE, TAG_REASONING_SEQUENCE, TAG_REASONING_SUBWFL, TAG_REASONING_TASK, TAG_REASONING_TASK_INPUT, TAG_REASONING_TASK_OUTPUT, TAG_REASONING_WFL, TAG_SEMANTICDESCRIPTION, URI_RWFL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
overwritten copy-method from Object; use it to copy a complete operatorgetName()
Each io component must have a name that is used inIOFactory.newIO(String)
.void
Adds the namespace-imports of this handler to the given xmlWriter.boolean
isHandlerFor
(Class value) Checks if the io component is capable to perform the operation for objects of this class.void
store
(Object value, GenericXMLSchemaBasedWriter writer) To embed xml writers into another one it must be possible to specify the parentGenericXMLSchemaBasedWriter
as well as a prefix that should be probably used.protected void
writeReasoningWorkflow
(WorkflowObject value, GenericXMLSchemaBasedWriter writer) Writes the complete workflow-content of the given AdaptationCase-object.Methods inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.AbstractXMLWriter
createXMLWriter, setFilename, setOutputStream, store, storeWithFamiliarWriter
Methods inherited from class de.uni_trier.wi2.procake.data.io.IOImpl
getFamily, getParameters, postInit, preInit, setFamily
Methods inherited from class de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
getParameter, initParametersBasedOn
-
Field Details
-
WRITER_NAME
ConstantWRITERNAME="XercesSaxWorkflowWriter"
- See Also:
-
-
Constructor Details
-
WorkflowWriter
public WorkflowWriter()
-
-
Method Details
-
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
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:
isHandlerFor
in interfaceIO
- Parameters:
value
- The class that has to be checked.- Returns:
- Results
true
if the class can oeprate with the given class.
-
copy
overwritten copy-method from Object; use it to copy a complete operator -
insertNamespace
Adds the namespace-imports of this handler to the given xmlWriter.- Specified by:
insertNamespace
in classAbstractXMLWriter
- Parameters:
writer
- aGenericXMLSchemaBasedWriter
object
-
store
To embed xml writers into another one it must be possible to specify the parentGenericXMLSchemaBasedWriter
as well as a prefix that should be probably used. If a parent writer is specified, no header will be written.If the writer does not support XML writing, the writer should throw an
UnsupportedOperationException
.public void store(Object value, String prefix, XMLWriter writer) throws CakeIOException { throw new UnsupportedOperationException(); }
- Specified by:
store
in classAbstractXMLWriter
- Parameters:
value
- aObject
objectwriter
- A parent writer that is used.- Throws:
CAKEIOException
- if any.
-
writeReasoningWorkflow
protected void writeReasoningWorkflow(WorkflowObject value, GenericXMLSchemaBasedWriter writer) throws XMLStreamException, CAKEIOException, IOException, InvalidNativeValueException Writes the complete workflow-content of the given AdaptationCase-object.- Parameters:
value
- The AdapationCase-object from which the workflow should be written.writer
- The writer to write the output to.- Throws:
XMLStreamException
CAKEIOException
IOException
InvalidNativeValueException
-