net.sf.jsefa.common.config
Class Configuration<R extends TypeMappingRegistry<?>,E extends EntryPoint<?,?>>

java.lang.Object
  extended by net.sf.jsefa.common.config.Configuration<R,E>
Type Parameters:
R - the type of the TypeMappingRegistry
E - the type of the EntryPoint
Direct Known Subclasses:
RbfConfiguration, XmlConfiguration

public abstract class Configuration<R extends TypeMappingRegistry<?>,E extends EntryPoint<?,?>>
extends Object

The abstract superclass for configuration object classes. It uses lazy initialization.

A configuration object is used when creating a new IOFactory. One configuration object can be used for the creation of multiple factories as each new factory holds its own copy of the configuration object. So the configuration object can be changed after creating a factory with it without affecting the configuration of the factory.

Author:
Norman Lahme-Huetig

Nested Class Summary
static interface Configuration.Defaults
          Set of default configuration values.
 
Constructor Summary
protected Configuration()
          Constructs a new Configuration.
protected Configuration(Configuration<R,E> other)
          Constructs a new Configuration as a copy of the given one.
 
Method Summary
abstract  Configuration<R,E> createCopy()
          Creates a copy of this Configuration.
protected abstract  R createDefaultTypeMappingRegistry()
          Creates the default type mapping registry to be used if none is explicitly given.
 Collection<E> getEntryPoints()
          Returns the entry points.
 ObjectAccessorProvider getObjectAccessorProvider()
          Returns the object accessor provider.
 SimpleTypeConverterProvider getSimpleTypeConverterProvider()
          Returns the simple type converter provider.
 R getTypeMappingRegistry()
          Returns the type mapping registry.
 ValidationMode getValidationMode()
          Returns the validation mode.
 ValidatorProvider getValidatorProvider()
          Returns the validator provider.
 void setEntryPoints(Collection<E> entryPoints)
          Sets the entry points.
 void setObjectAccessorProvider(ObjectAccessorProvider objectAccessorProvider)
          Sets the ObjectAccessorProvider.
 void setSimpleTypeConverterProvider(SimpleTypeConverterProvider simpleTypeConverterProvider)
          Sets the SimpleTypeConverterProvider.
 void setTypeMappingRegistry(R typeMappingRegistry)
          Sets the type mapping registry.
 void setValidationMode(ValidationMode validationMode)
          Sets the validation mode.
 void setValidatorProvider(ValidatorProvider validatorProvider)
          Sets the ValidatorProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

protected Configuration()
Constructs a new Configuration.


Configuration

protected Configuration(Configuration<R,E> other)
Constructs a new Configuration as a copy of the given one.

Parameters:
other - the other config
Method Detail

getTypeMappingRegistry

public final R getTypeMappingRegistry()
Returns the type mapping registry.

Returns:
the type mapping registry

setTypeMappingRegistry

public final void setTypeMappingRegistry(R typeMappingRegistry)
Sets the type mapping registry.

Parameters:
typeMappingRegistry - a type mapping registry

getEntryPoints

public final Collection<E> getEntryPoints()
Returns the entry points. An entry point is required for every type of object which will be passed to Serializer.write(java.lang.Object) or which should be returned from Deserializer.next() and only for these objects (not for the objects related to these ones). If more than one entry point is defined for the same data type name, then
a) the last one is used for serialization
b) all are used for deserialization whereas their respective designators are used as alternative designators for the same data type.

Returns:
the entry points.

setEntryPoints

public final void setEntryPoints(Collection<E> entryPoints)
Sets the entry points.

Parameters:
entryPoints - the entry points

getObjectAccessorProvider

public final ObjectAccessorProvider getObjectAccessorProvider()
Returns the object accessor provider.

Returns:
the object accessor provider

getSimpleTypeConverterProvider

public final SimpleTypeConverterProvider getSimpleTypeConverterProvider()
Returns the simple type converter provider.

Returns:
the simple type converter provider

getValidatorProvider

public final ValidatorProvider getValidatorProvider()
Returns the validator provider.

Returns:
the validator provider

getValidationMode

public final ValidationMode getValidationMode()
Returns the validation mode.

Returns:
the validation mode

setObjectAccessorProvider

public final void setObjectAccessorProvider(ObjectAccessorProvider objectAccessorProvider)
Sets the ObjectAccessorProvider.

Parameters:
objectAccessorProvider - the ObjectAccessorProvider

setSimpleTypeConverterProvider

public final void setSimpleTypeConverterProvider(SimpleTypeConverterProvider simpleTypeConverterProvider)
Sets the SimpleTypeConverterProvider.

Parameters:
simpleTypeConverterProvider - the SimpleTypeConverterProvider

setValidatorProvider

public final void setValidatorProvider(ValidatorProvider validatorProvider)
Sets the ValidatorProvider.

Parameters:
validatorProvider - the ValidatorProvider

setValidationMode

public final void setValidationMode(ValidationMode validationMode)
Sets the validation mode.

Parameters:
validationMode - the validation mode

createCopy

public abstract Configuration<R,E> createCopy()
Creates a copy of this Configuration.

Returns:
a copy of this Configuration

createDefaultTypeMappingRegistry

protected abstract R createDefaultTypeMappingRegistry()
Creates the default type mapping registry to be used if none is explicitly given.

Returns:
the default type mapping registry


Copyright © 2014. All rights reserved.