Class ObjectWriterImpl
- 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
-
- All Implemented Interfaces:
ObjectTags,IO,Writer
- Direct Known Subclasses:
NESTGraphWriterImpl
public class ObjectWriterImpl extends XMLWriterImpl implements ObjectTags
ObjectWriterImpl class.
- Author:
- kmaximi
-
-
Field Summary
Fields Modifier and Type Field Description static StringWRITERNAMEConstantWRITERNAME="ObjectSaxWriter"-
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.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 ObjectWriterImpl()
-
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 voidwrite(DataObject object, DataClass attributeType, XMLSchemaBasedWriter writer)write.protected voidwriteAggregateContent(AggregateObject object, DataClass attributeClass, XMLSchemaBasedWriter writer)writeAggregateContent.protected voidwriteId(DataObject object, XMLSchemaBasedWriter writer)writeId.protected voidwriteProperties(DataObject object, XMLSchemaBasedWriter writer)writeProperties.protected voidwriteVoid(VoidObject object, DataClass attributeType, XMLSchemaBasedWriter writer)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="ObjectSaxWriter"- 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 classIOImpl- 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()).
-
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.
-
copy
public IO copy()
overwritten copy-method from Object; use it to copy a complete operator
-
insertNamespace
public void insertNamespace(XMLSchemaBasedWriter writer)
Adds the namespace-imports of this handler to the given xmlWriter.- Specified by:
insertNamespacein classXMLWriterImpl- 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(); }- Specified by:
storein classXMLWriterImpl- Parameters:
value- aObjectobjectwriter- A parent writer that is used.- Throws:
CakeIOException- if any.
-
writeAggregateContent
protected void writeAggregateContent(AggregateObject object, DataClass attributeClass, XMLSchemaBasedWriter writer) throws InvalidNativeValueException, IOException, CakeIOException
writeAggregateContent.
- Parameters:
object- aAggregateObjectobjectattributeClass- aDataClassobjectwriter- aXMLSchemaBasedWriterobject- Throws:
InvalidNativeValueException- if any.IOException- if any.CakeIOException- if any.
-
write
protected void write(DataObject object, DataClass attributeType, XMLSchemaBasedWriter writer) throws InvalidNativeValueException, IOException, CakeIOException
write.
- Parameters:
object- aDataObjectobjectattributeType- aDataClassobjectwriter- aXMLSchemaBasedWriterobject- Throws:
InvalidNativeValueException- if any.IOException- if any.CakeIOException- if any.
-
writeVoid
protected void writeVoid(VoidObject object, DataClass attributeType, XMLSchemaBasedWriter writer) throws IOException
writeVoid.
- Parameters:
object- aVoidObjectobjectattributeType- aDataClassobjectwriter- aXMLSchemaBasedWriterobject- Throws:
IOException- if any.
-
writeProperties
protected void writeProperties(DataObject object, XMLSchemaBasedWriter writer) throws IOException
writeProperties.
- Parameters:
object- aDataObjectobjectwriter- aXMLSchemaBasedWriterobject- Throws:
IOException- if any.
-
writeId
protected void writeId(DataObject object, XMLSchemaBasedWriter writer) throws IOException
writeId.
- Parameters:
object- aDataObjectobjectwriter- aXMLSchemaBasedWriterobject- Throws:
IOException- if any.
-
-