com.cedarsoft.serialization.stax
Class AbstractStaxMateSerializingStrategy<T>

java.lang.Object
  extended by com.cedarsoft.serialization.AbstractSerializer<T,org.codehaus.staxmate.out.SMOutputElement,org.codehaus.stax2.XMLStreamReader2,javax.xml.stream.XMLStreamException>
      extended by com.cedarsoft.serialization.stax.AbstractStaxMateSerializer<T>
          extended by com.cedarsoft.serialization.stax.AbstractStaxMateSerializingStrategy<T>
Type Parameters:
T - the type
All Implemented Interfaces:
ExtendedSerializer<T>, PluggableSerializer<T,org.codehaus.staxmate.out.SMOutputElement,org.codehaus.stax2.XMLStreamReader2,javax.xml.stream.XMLStreamException>, Serializer<T,Lookup>, SerializingStrategy<T,org.codehaus.staxmate.out.SMOutputElement,org.codehaus.stax2.XMLStreamReader2>, StaxMateSerializingStrategy<T>

public abstract class AbstractStaxMateSerializingStrategy<T>
extends AbstractStaxMateSerializer<T>
implements StaxMateSerializingStrategy<T>

Attention: On deserialization every subclass has to *consume* everything including the end event for their tag.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.cedarsoft.serialization.stax.AbstractStaxMateSerializer
AbstractStaxMateSerializer.CB
 
Constructor Summary
protected AbstractStaxMateSerializingStrategy(java.lang.String id, java.lang.Class<? extends T> supportedType)
           
 
Method Summary
 T deserialize(org.codehaus.stax2.XMLStreamReader2 deserializeFrom)
          Deserializes the file reference
 java.lang.String getId()
          Returns the id
 org.codehaus.staxmate.out.SMOutputElement serialize(org.codehaus.staxmate.out.SMOutputElement serializeTo, T object)
          Serializes the reference
 boolean supports(java.lang.Object object)
          Whether the given reference type is supported
 
Methods inherited from class com.cedarsoft.serialization.stax.AbstractStaxMateSerializer
closeTag, deserialize, ensureTag, getChildText, getText, nextTag, serialize, visitChildren
 
Methods inherited from class com.cedarsoft.serialization.AbstractSerializer
deserialize, getDefaultElementName, serialize, serialize
 
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

AbstractStaxMateSerializingStrategy

protected AbstractStaxMateSerializingStrategy(@NotNull
                                              java.lang.String id,
                                              @NotNull
                                              java.lang.Class<? extends T> supportedType)
Method Detail

getId

@NotNull
public java.lang.String getId()
Description copied from interface: SerializingStrategy
Returns the id

Specified by:
getId in interface SerializingStrategy<T,org.codehaus.staxmate.out.SMOutputElement,org.codehaus.stax2.XMLStreamReader2>
Returns:
the id

supports

public boolean supports(@NotNull
                        java.lang.Object object)
Description copied from interface: SerializingStrategy
Whether the given reference type is supported

Specified by:
supports in interface SerializingStrategy<T,org.codehaus.staxmate.out.SMOutputElement,org.codehaus.stax2.XMLStreamReader2>
Parameters:
object - the reference
Returns:
true if this strategy supports the reference, false otherwise

serialize

@NotNull
public org.codehaus.staxmate.out.SMOutputElement serialize(@NotNull
                                                                   org.codehaus.staxmate.out.SMOutputElement serializeTo,
                                                                   @NotNull
                                                                   T object)
                                                    throws java.io.IOException
Description copied from interface: SerializingStrategy
Serializes the reference

Specified by:
serialize in interface SerializingStrategy<T,org.codehaus.staxmate.out.SMOutputElement,org.codehaus.stax2.XMLStreamReader2>
Parameters:
serializeTo - the serializeTo
object - the object
Returns:
the output serializeTo (for fluent usage)
Throws:
java.io.IOException

deserialize

@NotNull
public T deserialize(@NotNull@NonNls
                             org.codehaus.stax2.XMLStreamReader2 deserializeFrom)
              throws java.io.IOException
Description copied from interface: SerializingStrategy
Deserializes the file reference

Specified by:
deserialize in interface SerializingStrategy<T,org.codehaus.staxmate.out.SMOutputElement,org.codehaus.stax2.XMLStreamReader2>
Parameters:
deserializeFrom - the deserializeFrom
Returns:
the file reference
Throws:
java.io.IOException


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.