org.specrunner.converters.core
Class ConverterEnumTemplate

java.lang.Object
  extended by org.specrunner.converters.core.ConverterNotNullNotEmpty
      extended by org.specrunner.converters.core.ConverterEnum
          extended by org.specrunner.converters.core.ConverterEnumTemplate
All Implemented Interfaces:
Serializable, IConverter, IResetable

public abstract class ConverterEnumTemplate
extends ConverterEnum

Template for converter of enumerations. Allow creation of converters with specific names without requiring to write arguments when used.

Author:
Thiago Santos.
See Also:
Serialized Form

Constructor Summary
ConverterEnumTemplate(Class<? extends Enum<?>> type, String lookupMethod)
          Conversion of specific types.
 
Method Summary
 Object convert(Object obj, Object[] args)
          Convert a given object to another using some arguments as auxiliary.
 
Methods inherited from class org.specrunner.converters.core.ConverterNotNullNotEmpty
accept, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterEnumTemplate

public ConverterEnumTemplate(Class<? extends Enum<?>> type,
                             String lookupMethod)
Conversion of specific types.

Parameters:
type - The type.
lookupMethod - The method to use on enumeration lookup.
Method Detail

convert

public Object convert(Object obj,
                      Object[] args)
               throws ConverterException
Description copied from interface: IConverter
Convert a given object to another using some arguments as auxiliary.

Specified by:
convert in interface IConverter
Overrides:
convert in class ConverterEnum
Parameters:
obj - The value to be converted.
args - The arguments.
Returns:
The converted object.
Throws:
ConverterException - On conversion errors.


Copyright © 2014. All rights reserved.