com.cedarsoft.serialization
Class AbstractDelegatingSerializer<T>

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

public class AbstractDelegatingSerializer<T>
extends AbstractSerializer<T>


Field Summary
 
Fields inherited from class com.cedarsoft.serialization.AbstractSerializer
LINE_SEPARATOR
 
Constructor Summary
AbstractDelegatingSerializer(java.lang.String defaultElementName, java.util.Collection<? extends SerializingStrategy<? extends T>> strategies)
           
AbstractDelegatingSerializer(java.lang.String defaultElementName, SerializingStrategy<? extends T>... strategies)
           
 
Method Summary
 T deserialize(org.jdom.Element element, Lookup context)
          Deserializes the object from the diven document
 java.util.Collection<? extends SerializingStrategy<? extends T>> getStrategies()
           
 org.jdom.Element serialize(org.jdom.Element element, T object, Lookup context)
          Serializes the object to the given element
 
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
 

Constructor Detail

AbstractDelegatingSerializer

public AbstractDelegatingSerializer(@NotNull
                                    java.lang.String defaultElementName,
                                    @NotNull
                                    SerializingStrategy<? extends T>... strategies)

AbstractDelegatingSerializer

public AbstractDelegatingSerializer(@NotNull
                                    java.lang.String defaultElementName,
                                    @NotNull
                                    java.util.Collection<? extends SerializingStrategy<? extends T>> strategies)
Method Detail

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

getStrategies

@NotNull
public java.util.Collection<? extends SerializingStrategy<? extends T>> getStrategies()


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.