org.idoox.wasp.serialization
Interface SerializationRepository


public interface SerializationRepository

Contains all the (custom) serializers and deserializers.

The implementation of this class is obtained via Context.getInstance();

Since:
4.0
Component:
Core

Method Summary
 void addFaultSerialization(Configurable c)
          Adds a fault serialization group.
 void addSerialization(Configurable c)
          Adds a serialization group.
 DeserializationContext createDeserializationContext(java.lang.String serializationID, java.lang.String encodingURI)
          Creates a new deserialization context.
 SerializationContext createSerializationContext(java.lang.String serializationID, java.lang.String encodingURI)
          Creates a new serialization context.
 TypeMappingContext createTypeMappingContext(java.lang.String serializationID, java.lang.String encodingURI, java.lang.String language)
          Creates a new type mapping context.
 FaultDeserializer getFaultDeserializer(java.lang.String faultSerializationID, Fault fault)
          Returns a fault deserializer.
 FaultSerializer getFaultSerializer(java.lang.String faultSerializationID, java.lang.Throwable exception)
          Returns a fault serializer.
 java.util.Map getNamespaceLocationMap(java.lang.String serializationID, java.lang.String encodingURI)
          Returns an unmodifiable map of [namespaceURI(String) -> locationURL(String)].
 void releaseDeserializationContext(DeserializationContext ctx)
          Releases a deserialization context obtained through createDeserializationContext, so that it can be further reused.
 void releaseSerializationContext(SerializationContext ctx)
          Releases a serialization context obtained through createSerializationContext, so that it can be further reused.
 void releaseTypeMappingContext(TypeMappingContext ctx)
          Releases a type mapping context obtained through createTypeMappingContext, so that it can be further reused.
 void removeFaultSerialization(java.lang.String name)
          Removes a fault serialization group.
 void removeSerialization(java.lang.String name)
          Removes a serialization group.
 

Method Detail

createDeserializationContext

public DeserializationContext createDeserializationContext(java.lang.String serializationID,
                                                           java.lang.String encodingURI)
Creates a new deserialization context.

Parameters:
serializationID - the id of the serialization group
encodingURI - the encoding for which the deserialization context is created. This parameter is used to select which default deserializers should be used.
Returns:
the newly created deserialization context

releaseDeserializationContext

public void releaseDeserializationContext(DeserializationContext ctx)
Releases a deserialization context obtained through createDeserializationContext, so that it can be further reused.

Parameters:
ctx - the deserialization context being released

createSerializationContext

public SerializationContext createSerializationContext(java.lang.String serializationID,
                                                       java.lang.String encodingURI)
Creates a new serialization context.

Parameters:
serializationID - the id of the group of serializers
encodingURI - the encoding for which the serialization context is created. This parameter is used to select which default serializers should be used.
Returns:
the newly created serialization context

releaseSerializationContext

public void releaseSerializationContext(SerializationContext ctx)
Releases a serialization context obtained through createSerializationContext, so that it can be further reused.

Parameters:
ctx - the serialization context to be released

createTypeMappingContext

public TypeMappingContext createTypeMappingContext(java.lang.String serializationID,
                                                   java.lang.String encodingURI,
                                                   java.lang.String language)
Creates a new type mapping context.

Parameters:
serializationID - the id of the group of serializers
encodingURI - the encoding for which the type mapping context is created. This parameter is used to select which default type mapping should be used.
language - the target language (for example java)
Returns:
the newly created type mapping context

releaseTypeMappingContext

public void releaseTypeMappingContext(TypeMappingContext ctx)
Releases a type mapping context obtained through createTypeMappingContext, so that it can be further reused.

Parameters:
ctx - the type mapping context to be released

getFaultSerializer

public FaultSerializer getFaultSerializer(java.lang.String faultSerializationID,
                                          java.lang.Throwable exception)
Returns a fault serializer.

Parameters:
faultSerializationID - id of the group of fault serializers
exception - the exception to be serialized
Returns:
the serializer for the fault

getFaultDeserializer

public FaultDeserializer getFaultDeserializer(java.lang.String faultSerializationID,
                                              Fault fault)
Returns a fault deserializer.

Parameters:
faultSerializationID - id of the group of fault serializers
fault - the fault to be deserialized
Returns:
the deserializer for the fault

getNamespaceLocationMap

public java.util.Map getNamespaceLocationMap(java.lang.String serializationID,
                                             java.lang.String encodingURI)
Returns an unmodifiable map of [namespaceURI(String) -> locationURL(String)].

Parameters:
serializationID - the serialization ID for which the location map is to be returned
encodingURI - the encoding to be used
Returns:
the namespace mapping or null if has not been found

addSerialization

public void addSerialization(Configurable c)
Adds a serialization group.

Parameters:
c - the configurable of the group

removeSerialization

public void removeSerialization(java.lang.String name)
Removes a serialization group.

Parameters:
name - the name of the group

addFaultSerialization

public void addFaultSerialization(Configurable c)
Adds a fault serialization group.

Parameters:
c - the configurable of the group

removeFaultSerialization

public void removeFaultSerialization(java.lang.String name)
Removes a fault serialization group.

Parameters:
name - the name of the group