com.cedarsoft.serialization.jdom
Class AbstractJDomSerializingStrategy<T>

java.lang.Object
  extended by com.cedarsoft.serialization.AbstractSerializer<T,org.jdom.Element,org.jdom.Element,java.io.IOException>
      extended by com.cedarsoft.serialization.jdom.AbstractJDomSerializer<T>
          extended by com.cedarsoft.serialization.jdom.AbstractJDomSerializingStrategy<T>
Type Parameters:
T - the type
All Implemented Interfaces:
ExtendedSerializer<T>, JDomSerializingStrategy<T>, PluggableSerializer<T,org.jdom.Element,org.jdom.Element,java.io.IOException>, Serializer<T,Lookup>, SerializingStrategy<T,org.jdom.Element,org.jdom.Element>

public abstract class AbstractJDomSerializingStrategy<T>
extends AbstractJDomSerializer<T>
implements JDomSerializingStrategy<T>


Field Summary
 
Fields inherited from class com.cedarsoft.serialization.jdom.AbstractJDomSerializer
LINE_SEPARATOR
 
Fields inherited from interface com.cedarsoft.serialization.Serializer
PI_TARGET_FORMAT
 
Constructor Summary
protected AbstractJDomSerializingStrategy(java.lang.String id, java.lang.Class<? extends T> supportedType, VersionRange formatVersionRange)
           
 
Method Summary
 T deserialize(org.jdom.Element deserializeFrom, Lookup context)
          Deserializes the object from the given document
 java.lang.String getId()
          Returns the id
 org.jdom.Element serialize(org.jdom.Element serializeTo, 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.jdom.AbstractJDomSerializer
deserialize, serialize, serializeToElement
 
Methods inherited from class com.cedarsoft.serialization.AbstractSerializer
deserialize, getDefaultElementName, getFormatVersion, getFormatVersionRange, serialize, serialize, 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.SerializingStrategy
deserialize, serialize
 

Constructor Detail

AbstractJDomSerializingStrategy

protected AbstractJDomSerializingStrategy(@NotNull
                                          java.lang.String id,
                                          @NotNull
                                          java.lang.Class<? extends T> supportedType,
                                          @NotNull
                                          VersionRange formatVersionRange)
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.jdom.Element,org.jdom.Element>
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.jdom.Element,org.jdom.Element>
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 serializeTo,
                                          @NotNull
                                          T object,
                                          @NotNull
                                          Lookup context)
                           throws java.io.IOException
Description copied from interface: PluggableSerializer
Serializes the object to the given element

Specified by:
serialize in interface PluggableSerializer<T,org.jdom.Element,org.jdom.Element,java.io.IOException>
Parameters:
serializeTo - the serializeTo
object - the object
context - the context
Returns:
the serializeTo (for fluent writing)
Throws:
java.io.IOException

deserialize

@NotNull
public T deserialize(@NotNull
                             org.jdom.Element deserializeFrom,
                             @NotNull
                             Lookup context)
              throws java.io.IOException
Description copied from interface: PluggableSerializer
Deserializes the object from the given document

Specified by:
deserialize in interface PluggableSerializer<T,org.jdom.Element,org.jdom.Element,java.io.IOException>
Parameters:
deserializeFrom - the deserializeFrom
context - the context
Returns:
the deserialized object
Throws:
java.io.IOException


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.