Class NESTGraphWriter
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.ObjectWriter
de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.NESTGraphWriter
- All Implemented Interfaces:
NESTGraphTags
,ObjectTags
,IO
,ProCAKEWriter
- Direct Known Subclasses:
NESTSequentialWorkflowWriter
This class serializes a
NESTGraphObject
to XML.- Author:
- Alexander Schultheis
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constant value is "XercesSaxNESTGraphWriter".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.data.io.xml.NESTGraphTags
ATT_CLASS, ATT_ID, ATT_POST, ATT_PRE, ATT_REF_ID, LOG_VALUE_FROM_ATTRIBUTE_IS_NULL, PREFIX_NEST, SCHEMA_LOCATION_NEST, TAG_EDGE, TAG_EDGES, TAG_NESTGRAPH, TAG_NESTSEQUENTIALWORKFLOW, TAG_NESTWORKFLOW, TAG_NODE, TAG_NODES, URI_NEST, VAL_EDGE, VAL_NODE
Fields inherited from interface de.uni_trier.wi2.procake.data.io.xml.ObjectTags
ATT_CLASS, ATT_ID, ATT_NAME, ATT_VALUE, PREFIX_CDOL, SCHEMA_LOCATION_CDOL, TAG_AGGREGATE, TAG_ATOMIC, TAG_ATOMIC_ATTRIBUTE, TAG_ATTRIBUTE, TAG_ATTRIBUTEPATH, TAG_BYTE_ARRAY, TAG_BYTE_ARRAY_CONTENT, TAG_COLLECTION, TAG_INTERVAL, TAG_INTERVAL_LOWER_BOUND, TAG_INTERVAL_UPPER_BOUND, TAG_OBJECT_ATTRIBUTE, TAG_PROPERTY, TAG_QUERY, TAG_VOID, TAG_VOID_ATTRIBUTE, URI_CDOL
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.ProCAKEWriter
LOG_CANNOT_WRITE
-
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
writeEdge
(NESTEdgeObject value, GenericXMLSchemaBasedWriter writer) Writes the Edge-object to the XMLWriter.protected void
writeNESTGraph
(NESTGraphObject value, GenericXMLSchemaBasedWriter writer, String rootTag) Writes the given NESTGraph-object into the XMLWriter.protected void
writeNode
(NESTNodeObject value, GenericXMLSchemaBasedWriter writer) Writes the Node-object into the XMLWriter.protected void
Writes the semantic part of the given NESTGraphItem to the XMLWriter.Methods inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.ObjectWriter
getParameters, isWriteAtomicObjectId, isWriteVoidObjectId, preInit, setWriteAtomicObjectId, setWriteVoidObjectId, write, writeAggregateContent, writeId, writeProperties, writeVoid
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.utils.composition.FactoryObjectImplementation
getParameter, initParametersBasedOn
-
Field Details
-
WRITER_NAME
Constant value is "XercesSaxNESTGraphWriter".- See Also:
-
-
Constructor Details
-
NESTGraphWriter
public NESTGraphWriter()
-
-
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()
).- Specified by:
getName
in interfaceIO
- Overrides:
getName
in classObjectWriter
- Returns:
- Returns the name of the io component.
-
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
- Overrides:
isHandlerFor
in classObjectWriter
- 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- Specified by:
copy
in interfaceIO
- Overrides:
copy
in classObjectWriter
- Returns:
-
insertNamespace
Adds the namespace-imports of this handler to the given xmlWriter.- Overrides:
insertNamespace
in classObjectWriter
- 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(); }
- Overrides:
store
in classObjectWriter
- Parameters:
value
- aObject
objectwriter
- A parent writer that is used.- Throws:
CAKEIOException
- if any.
-
writeNESTGraph
protected void writeNESTGraph(NESTGraphObject value, GenericXMLSchemaBasedWriter writer, String rootTag) throws XMLStreamException, IOException, CAKEIOException, InvalidNativeValueException Writes the given NESTGraph-object into the XMLWriter.- Parameters:
value
- The NESTGraph-object to write.writer
- The writer to write the output to.rootTag
- the tag to use for the NEST graph- Throws:
XMLStreamException
IOException
CAKEIOException
InvalidNativeValueException
-
writeNode
protected void writeNode(NESTNodeObject value, GenericXMLSchemaBasedWriter writer) throws XMLStreamException, CAKEIOException, IOException, InvalidNativeValueException Writes the Node-object into the XMLWriter.- Parameters:
value
- The Node-object to write.writer
- The writer to write the output to.- Throws:
XMLStreamException
CAKEIOException
InvalidNativeValueException
IOException
-
writeEdge
protected void writeEdge(NESTEdgeObject value, GenericXMLSchemaBasedWriter writer) throws XMLStreamException, CAKEIOException, IOException, InvalidNativeValueException Writes the Edge-object to the XMLWriter.- Parameters:
value
- The Edge-object to write.writer
- The writer to write the output to.- Throws:
XMLStreamException
CAKEIOException
InvalidNativeValueException
IOException
-
writeSemanticDescription
protected void writeSemanticDescription(NESTGraphItemObject item, GenericXMLSchemaBasedWriter writer) throws CAKEIOException, IOException, InvalidNativeValueException Writes the semantic part of the given NESTGraphItem to the XMLWriter.- Parameters:
item
- The NESTGraphItemObject, from which the semantic part should be written.writer
- The writer to write the output to.- Throws:
CAKEIOException
InvalidNativeValueException
IOException
-