Package org.ldaptive.beans.reflect
Class TranscoderFactory
- java.lang.Object
-
- org.ldaptive.beans.reflect.TranscoderFactory
-
public final class TranscoderFactory extends Object
Creates value transcoders and stores them in a static map.
-
-
Field Summary
Fields Modifier and Type Field Description private static Map<String,ValueTranscoder<?>>
TRANSCODERS
Value transcoders.
-
Constructor Summary
Constructors Modifier Constructor Description private
TranscoderFactory()
Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static ValueTranscoder<?>
createValueTranscoder(String type)
Creates a value transcoder for the supplied type.static ValueTranscoder<?>
getInstance(String type)
Returns a value transcoder for the supplied type.
-
-
-
Field Detail
-
TRANSCODERS
private static final Map<String,ValueTranscoder<?>> TRANSCODERS
Value transcoders.
-
-
Method Detail
-
getInstance
public static ValueTranscoder<?> getInstance(String type)
Returns a value transcoder for the supplied type. If the type cannot be found it is instantiated and cached for future use.- Parameters:
type
- of value transcoder- Returns:
- value transcoder
-
createValueTranscoder
private static ValueTranscoder<?> createValueTranscoder(String type)
Creates a value transcoder for the supplied type.- Parameters:
type
- to create value transcoder for- Returns:
- value transcoder
- Throws:
IllegalArgumentException
- if the supplied type cannot be instantiated
-
-