com.cedarsoft.serialization.jdom
Class AbstractJDomSerializer<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>
Type Parameters:
T - the type
All Implemented Interfaces:
ExtendedSerializer<T>, PluggableSerializer<T,org.jdom.Element,org.jdom.Element,java.io.IOException>, Serializer<T,Lookup>
Direct Known Subclasses:
AbstractDelegatingJDomSerializer, AbstractJDomSerializingStrategy

public abstract class AbstractJDomSerializer<T>
extends AbstractSerializer<T,org.jdom.Element,org.jdom.Element,java.io.IOException>

Abstract serializer based on JDom


Field Summary
protected static java.lang.String LINE_SEPARATOR
           
 
Constructor Summary
protected AbstractJDomSerializer(java.lang.String defaultElementName)
           
 
Method Summary
 T deserialize(java.io.InputStream in, Lookup context)
          Deserializes the object from the input stream
 void serialize(T object, java.io.OutputStream out, Lookup context)
          Serializes the object to the given output stream
 org.jdom.Element serializeToElement(T object, Lookup context)
           
 
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
 

Field Detail

LINE_SEPARATOR

@NotNull
@NonNls
protected static final java.lang.String LINE_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

AbstractJDomSerializer

protected AbstractJDomSerializer(@NotNull@NonNls
                                 java.lang.String defaultElementName)
Method Detail

serializeToElement

@NotNull
public org.jdom.Element serializeToElement(@NotNull
                                                   T object,
                                                   @Nullable
                                                   Lookup context)
                                    throws java.io.IOException
Throws:
java.io.IOException

serialize

public void serialize(@NotNull
                      T object,
                      @NotNull
                      java.io.OutputStream out,
                      @Nullable
                      Lookup 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

deserialize

@NotNull
public T deserialize(@NotNull
                             java.io.InputStream in,
                             @Nullable
                             Lookup context)
              throws java.io.IOException
Description copied from interface: Serializer
Deserializes the object from the input stream

Parameters:
in - the input stream
context - the context (optional)
Returns:
the deserialized object
Throws:
java.io.IOException


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.