Class NESTGraphWriterImpl
- 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.XMLWriterImpl
-
- de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.ObjectWriterImpl
-
- de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.NESTGraphWriterImpl
-
- All Implemented Interfaces:
NESTGraphTags,ObjectTags,IO,Writer
- Direct Known Subclasses:
NESTSequentialWorkflowWriterImpl
public class NESTGraphWriterImpl extends ObjectWriterImpl implements NESTGraphTags
This class serializes aNESTGraphObjectto XML.- Author:
- Alexander Schultheis
-
-
Field Summary
Fields Modifier and Type Field Description static StringWRITERNAMEConstantWRITERNAME="XercesSaxNESTGraphWriter"-
Fields inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.XMLWriterImpl
filename, outputStream
-
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.data.io.xml.NESTGraphTags
ATT_CLASS, ATT_ID, ATT_POST, ATT_PRE, ATT_REF_ID, PREFIX_NEST, SCHEMA_LOCATION_NEST, TAG_EDGE, TAG_EDGES, TAG_NESTGRAPH, 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_ATOMICATTRIBUTE, TAG_ATTRIBUTE, TAG_ATTRIBUTEPATH, TAG_BYTEARRAY, TAG_BYTEARRAYCONTENT, 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.Writer
COMPONENT, COMPONENT_KEY, LOG_CANNOT_WRITE, LOG_NO_WRITER_FOUND, LOG_UNEXPECTED_IOEXCEPTION
-
-
Constructor Summary
Constructors Constructor Description NESTGraphWriterImpl()
-
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 operatorStringgetDescription()A description of the io component.StringgetName()Each io component must have a name that is used inIOFactory.newIO(String).voidinsertNamespace(XMLSchemaBasedWriter writer)Adds the namespace-imports of this handler to the given xmlWriter.booleanisHandlerFor(Class value)Checks if the io component is capable to perform the operation for objects of this class.voidstore(Object value, XMLSchemaBasedWriter writer)To embed xml writers into another one it must be possible to specify the parentXMLSchemaBasedWriteras well as a prefix that should be probably used.protected voidwriteEdge(NESTEdgeObject value, XMLSchemaBasedWriter writer)Writes the Edge-object to the XMLWriter.protected voidwriteNode(NESTNodeObject value, XMLSchemaBasedWriter writer)Writes the Node-object into the XMLWriter.protected voidwriteSemanticDescription(NESTGraphItemObject item, XMLSchemaBasedWriter writer)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.ObjectWriterImpl
write, writeAggregateContent, writeId, writeProperties, writeVoid
-
Methods inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_writerImpl.XMLWriterImpl
correctPrefix, 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 Detail
-
WRITERNAME
public static final String WRITERNAME
ConstantWRITERNAME="XercesSaxNESTGraphWriter"- See Also:
- Constant Field Values
-
-
Method Detail
-
getDescription
public String getDescription()
A description of the io component. The description should contain the file format and the classes that can be managed.- Specified by:
getDescriptionin interfaceIO- Overrides:
getDescriptionin classObjectWriterImpl- Returns:
- a description of the io component
-
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()).- Specified by:
getNamein interfaceIO- Overrides:
getNamein classObjectWriterImpl- Returns:
- Returns the name of the io component.
-
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- Overrides:
isHandlerForin classObjectWriterImpl- Parameters:
value- The class that has to be checked.- Returns:
- Results
trueif the class can oeprate with the given class.
-
copy
public IO copy()
overwritten copy-method from Object; use it to copy a complete operator- Specified by:
copyin interfaceIO- Overrides:
copyin classObjectWriterImpl- Returns:
-
insertNamespace
public void insertNamespace(XMLSchemaBasedWriter writer)
Adds the namespace-imports of this handler to the given xmlWriter.- Overrides:
insertNamespacein classObjectWriterImpl- Parameters:
writer- aXMLSchemaBasedWriterobject
-
store
public void store(Object value, XMLSchemaBasedWriter writer) throws CakeIOException
To embed xml writers into another one it must be possible to specify the parentXMLSchemaBasedWriteras 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:
storein classObjectWriterImpl- Parameters:
value- aObjectobjectwriter- A parent writer that is used.- Throws:
CakeIOException- if any.
-
writeNode
protected void writeNode(NESTNodeObject value, XMLSchemaBasedWriter 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:
XMLStreamExceptionCakeIOExceptionCakeIOExceptionInvalidNativeValueExceptionIOException
-
writeEdge
protected void writeEdge(NESTEdgeObject value, XMLSchemaBasedWriter 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:
XMLStreamExceptionCakeIOExceptionCakeIOExceptionInvalidNativeValueExceptionIOException
-
writeSemanticDescription
protected void writeSemanticDescription(NESTGraphItemObject item, XMLSchemaBasedWriter 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:
CakeIOExceptionCakeIOExceptionInvalidNativeValueExceptionIOException
-
-