net.sf.jsefa.rbf
Class RbfIOFactory<C extends Configuration<RbfTypeMappingRegistry,RbfEntryPoint>,S extends RbfSerializer,D extends RbfDeserializer>

java.lang.Object
  extended by net.sf.jsefa.rbf.RbfIOFactory<C,S,D>
Type Parameters:
C - the configuration type
S - the serializer type
D - the deserializer type
All Implemented Interfaces:
IOFactory

public abstract class RbfIOFactory<C extends Configuration<RbfTypeMappingRegistry,RbfEntryPoint>,S extends RbfSerializer,D extends RbfDeserializer>
extends Object
implements IOFactory

Abstract super class for RBF factories.

Instances of this class are immutable and thread-safe. This must be true for all subclasses, too.

Author:
Norman Lahme-Huetig

Constructor Summary
protected RbfIOFactory(C config)
          Constructs a new RbfIOFactory.
 
Method Summary
 D createDeserializer()
          Creates a new Deserializer.
protected abstract  D createDeserializer(C config, Map<String,RbfEntryPoint> entryPointsByPrefix)
          Creates a new ADeserializer.
protected abstract  D createDeserializer(C config, RbfEntryPoint entryPoint)
          Creates a new Deserializer.
 S createSerializer()
          Creates a new Serializer.
protected abstract  S createSerializer(C config, Map<Class<?>,RbfEntryPoint> entryPointsByObjectType)
          Creates a new Serializer.
protected  boolean prefixRequired(Collection<RbfEntryPoint> entryPoints)
          Returns true if and only if a prefix is required for the given entry points.
 boolean withPrefixes()
          Returns true if prefixes are used and false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RbfIOFactory

protected RbfIOFactory(C config)
Constructs a new RbfIOFactory.

Parameters:
config - the configuration
Method Detail

createSerializer

public final S createSerializer()
Creates a new Serializer.

Specified by:
createSerializer in interface IOFactory
Returns:
a Serializer

createDeserializer

public final D createDeserializer()
Creates a new Deserializer.

Specified by:
createDeserializer in interface IOFactory
Returns:
a new Deserializer

withPrefixes

public boolean withPrefixes()
Returns true if prefixes are used and false otherwise.

Returns:
true if prefixes are used; otherwise false

createSerializer

protected abstract S createSerializer(C config,
                                      Map<Class<?>,RbfEntryPoint> entryPointsByObjectType)
Creates a new Serializer.

Parameters:
config - the configuration
entryPointsByObjectType - a map from object types to entry points.
Returns:
a Serializer

createDeserializer

protected abstract D createDeserializer(C config,
                                        RbfEntryPoint entryPoint)
Creates a new Deserializer.

Parameters:
config - the configuration
entryPoint - the entry point
Returns:
a Deserializer

createDeserializer

protected abstract D createDeserializer(C config,
                                        Map<String,RbfEntryPoint> entryPointsByPrefix)
Creates a new ADeserializer.

Parameters:
config - the configuration
entryPointsByPrefix - a map from prefixes to entry points
Returns:
a Deserializer

prefixRequired

protected final boolean prefixRequired(Collection<RbfEntryPoint> entryPoints)
Returns true if and only if a prefix is required for the given entry points.

Parameters:
entryPoints - the entry points
Returns:
true, if a prefix is required; false otherwise.


Copyright © 2014. All rights reserved.