net.sf.jsefa.common.converter.provider
Class SimpleTypeConverterProvider

java.lang.Object
  extended by net.sf.jsefa.common.converter.provider.SimpleTypeConverterProvider

public final class SimpleTypeConverterProvider
extends Object

Provider for SimpleTypeConverter.

Each SimpleTypeConverter must have a static factory method create, which is either parameterless or has exactly one parameter of type SimpleTypeConverterConfiguration.

It is thread-safe.

Author:
Norman Lahme-Huetig

Constructor Summary
SimpleTypeConverterProvider()
          Constructs a SimpleTypeConverterProvider.
 
Method Summary
 SimpleTypeConverterProvider createCopy()
          Creates a copy of this SimpleTypeConverterProvider.
 SimpleTypeConverter getForConverterType(Class<? extends SimpleTypeConverter> converterType, Class<?> objectType, String[] format)
          Returns an instance of the given SimpleTypeConverter type initialized with the given format.
 SimpleTypeConverter getForConverterType(Class<? extends SimpleTypeConverter> converterType, Class<?> objectType, String[] format, SimpleTypeConverter itemTypeConverter)
          Returns an instance of the given SimpleTypeConverter type initialized with the given format.
 SimpleTypeConverter getForObjectType(Class<?> objectType, String[] format)
          Returns a SimpleTypeConverter for the given object type and format.
 SimpleTypeConverter getForObjectType(Class<?> objectType, String[] format, SimpleTypeConverter itemTypeConverter)
          Returns a SimpleTypeConverter for the given object type and format.
 boolean hasConverterFor(Class<?> objectType)
          Returns true if and only if this provider has a SimpleTypeConverter for the given object type.
 void registerConverterType(Class<?> objectType, Class<? extends SimpleTypeConverter> converterType)
          Registers the given SimpleTypeConverter type as being responsible for values of the given object type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTypeConverterProvider

public SimpleTypeConverterProvider()
Constructs a SimpleTypeConverterProvider.

Method Detail

createCopy

public SimpleTypeConverterProvider createCopy()
Creates a copy of this SimpleTypeConverterProvider.

Returns:
a copy of this SimpleTypeConverterProvider

hasConverterFor

public boolean hasConverterFor(Class<?> objectType)
Returns true if and only if this provider has a SimpleTypeConverter for the given object type.

Parameters:
objectType - the type of the object a converter is needed for
Returns:
true if this provider has a SimpleTypeConverter for the given type; false otherwise.

getForObjectType

public SimpleTypeConverter getForObjectType(Class<?> objectType,
                                            String[] format)
Returns a SimpleTypeConverter for the given object type and format.

Parameters:
objectType - the type of the object a converter is needed for
format - the format the converter must be initialized with
Returns:
the converter.

getForObjectType

public SimpleTypeConverter getForObjectType(Class<?> objectType,
                                            String[] format,
                                            SimpleTypeConverter itemTypeConverter)
Returns a SimpleTypeConverter for the given object type and format.

Parameters:
objectType - the type of the object a converter is needed for
format - the format the converter must be initialized with
itemTypeConverter - the item type converter
Returns:
the converter.

getForConverterType

public SimpleTypeConverter getForConverterType(Class<? extends SimpleTypeConverter> converterType,
                                               Class<?> objectType,
                                               String[] format)
Returns an instance of the given SimpleTypeConverter type initialized with the given format.

Parameters:
converterType - the SimpleTypeConverter type
objectType - the type of the object a converter is needed for
format - the format to initialize the converter with
Returns:
the converter

getForConverterType

public SimpleTypeConverter getForConverterType(Class<? extends SimpleTypeConverter> converterType,
                                               Class<?> objectType,
                                               String[] format,
                                               SimpleTypeConverter itemTypeConverter)
Returns an instance of the given SimpleTypeConverter type initialized with the given format.

Parameters:
converterType - the SimpleTypeConverter type
objectType - the type of the object a converter is needed for
format - the format to initialize the converter with
itemTypeConverter - the item type converter
Returns:
the converter

registerConverterType

public void registerConverterType(Class<?> objectType,
                                  Class<? extends SimpleTypeConverter> converterType)
Registers the given SimpleTypeConverter type as being responsible for values of the given object type.

Parameters:
objectType - the object type
converterType - the SimpleTypeConverter type


Copyright © 2014. All rights reserved.