org.easetech.easytest.converter
Class ConverterManager

java.lang.Object
  extended by org.easetech.easytest.converter.ConverterManager

public class ConverterManager
extends Object

A class that manages the registered Converters and makes them available to the framework. This class can be used to locate a Converter for any given type name.

Author:
Anuj Kumar

Field Summary
static ThreadLocal<Set<Converter>> converters
          A thread local variable that will hold the set of Converter for easy consumption by the test cases.
 
Constructor Summary
ConverterManager()
           
 
Method Summary
static void cleanConverters()
          Clean the thread local variable
static Converter<?> findConverter(Class<?> targetType)
          Find the registered Converter for the given class type
static void registerConverter(Class converterClass)
          Register the converter with the ConverterManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

converters

public static final ThreadLocal<Set<Converter>> converters
A thread local variable that will hold the set of Converter for easy consumption by the test cases.

Constructor Detail

ConverterManager

public ConverterManager()
Method Detail

findConverter

public static Converter<?> findConverter(Class<?> targetType)
Find the registered Converter for the given class type

Parameters:
targetType - the class type to find teh converter for.
Returns:
an instance of registered converter or Null if not found.

registerConverter

public static void registerConverter(Class converterClass)
Register the converter with the ConverterManager

Parameters:
converterClass - the class object identifying the concrete Converter class.

cleanConverters

public static void cleanConverters()
Clean the thread local variable



Copyright © 2013. All Rights Reserved.