com.cedarsoft.serialization
Class AbstractSerializingStrategy<T>

java.lang.Object
  extended by com.cedarsoft.serialization.AbstractSerializer<T>
      extended by com.cedarsoft.serialization.AbstractSerializingStrategy<T>
Type Parameters:
T - the type
All Implemented Interfaces:
ExtendedSerializer<T>, Serializer<T,Lookup>, SerializingStrategy<T>

public abstract class AbstractSerializingStrategy<T>
extends AbstractSerializer<T>
implements SerializingStrategy<T>


Field Summary
 
Fields inherited from class com.cedarsoft.serialization.AbstractSerializer
LINE_SEPARATOR
 
Constructor Summary
protected AbstractSerializingStrategy(java.lang.String id, java.lang.Class<? extends T> supportedType)
           
 
Method Summary
 T deserialize(org.jdom.Element element, Lookup context)
          Deserializes the object from the diven document
 java.lang.String getId()
          Returns the id
 org.jdom.Element serialize(org.jdom.Element element, T object, Lookup context)
          Serializes the object to the given element
 boolean supports(java.lang.Object object)
          Whether the given reference type is supported
 
Methods inherited from class com.cedarsoft.serialization.AbstractSerializer
deserialize, deserialize, getDefaultElementName, serialize, serialize, serialize, serializeToElement
 
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.SerializingStrategy
deserialize, serialize
 

Constructor Detail

AbstractSerializingStrategy

protected AbstractSerializingStrategy(@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>
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>
Parameters:
object - the reference
Returns:
true if this strategy supports the reference, false otherwise

serialize

@NotNull
public org.jdom.Element serialize(@NotNull
                                          org.jdom.Element element,
                                          @NotNull
                                          T object,
                                          @NotNull
                                          Lookup context)
                           throws java.io.IOException
Description copied from class: AbstractSerializer
Serializes the object to the given element

Specified by:
serialize in class AbstractSerializer<T>
Parameters:
element - the element
object - the object
context - the context
Returns:
the element (for fluent writing)
Throws:
java.io.IOException

deserialize

@NotNull
public T deserialize(@NotNull
                             org.jdom.Element element,
                             @NotNull
                             Lookup context)
              throws java.io.IOException
Description copied from class: AbstractSerializer
Deserializes the object from the diven document

Specified by:
deserialize in class AbstractSerializer<T>
Parameters:
element - the element
context - the context
Returns:
the deserialized object
Throws:
java.io.IOException


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.