com.cedarsoft.serialization.stax
Class AbstractStaxSerializer<T,C>

java.lang.Object
  extended by com.cedarsoft.serialization.AbstractSerializer<T,C,S,javax.xml.stream.XMLStreamReader,javax.xml.stream.XMLStreamException>
      extended by com.cedarsoft.serialization.stax.AbstractStaxBasedSerializer<T,C,javax.xml.stream.XMLStreamWriter>
          extended by com.cedarsoft.serialization.stax.AbstractStaxSerializer<T,C>
Type Parameters:
T - the type
C - the type of the context
All Implemented Interfaces:
PluggableSerializer<T,C,javax.xml.stream.XMLStreamWriter,javax.xml.stream.XMLStreamReader,javax.xml.stream.XMLStreamException>, Serializer<T,C>
Direct Known Subclasses:
AbstractStaxSerializingStrategy

public abstract class AbstractStaxSerializer<T,C>
extends AbstractStaxBasedSerializer<T,C,javax.xml.stream.XMLStreamWriter>


Nested Class Summary
 
Nested classes/interfaces inherited from class com.cedarsoft.serialization.stax.AbstractStaxBasedSerializer
AbstractStaxBasedSerializer.CB
 
Field Summary
 
Fields inherited from interface com.cedarsoft.serialization.Serializer
PI_TARGET_FORMAT
 
Constructor Summary
protected AbstractStaxSerializer(java.lang.String defaultElementName, VersionRange formatVersionRange)
           
 
Method Summary
 void serialize(T object, java.io.OutputStream out, C context)
          Serializes the object to the given output stream
protected  void serializeFormatVersion(javax.xml.stream.XMLStreamWriter writer, Version formatVersion)
          Serializes the format version to the given element
 
Methods inherited from class com.cedarsoft.serialization.stax.AbstractStaxBasedSerializer
closeTag, deserialize, ensureTag, getChildText, getProcessingInstructionData, getText, nextTag, visitChildren
 
Methods inherited from class com.cedarsoft.serialization.AbstractSerializer
deserialize, getDefaultElementName, getFormatVersion, getFormatVersionRange, serialize, serializeToByteArray, verifyDelegatingSerializerVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cedarsoft.serialization.PluggableSerializer
deserialize, serialize
 

Constructor Detail

AbstractStaxSerializer

protected AbstractStaxSerializer(@NotNull@NonNls
                                 java.lang.String defaultElementName,
                                 @NotNull
                                 VersionRange formatVersionRange)
Method Detail

serialize

public void serialize(@NotNull
                      T object,
                      @NotNull
                      java.io.OutputStream out,
                      @Nullable
                      C context)
               throws java.io.IOException
Description copied from interface: Serializer
Serializes the object to the given output stream

Parameters:
object - the object
out - the out stream
context - the context (optional)
Throws:
java.io.IOException

serializeFormatVersion

protected void serializeFormatVersion(@NotNull
                                      javax.xml.stream.XMLStreamWriter writer,
                                      @NotNull
                                      Version formatVersion)
                               throws javax.xml.stream.XMLStreamException
Serializes the format version to the given element

Parameters:
writer - the writer
formatVersion - the format version
Throws:
javax.xml.stream.XMLStreamException


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.