org.specrunner.converters.core
Class ConverterEnumValue

java.lang.Object
  extended by org.specrunner.converters.core.ConverterDefault
      extended by org.specrunner.converters.core.ConverterNotNullNotEmpty
          extended by org.specrunner.converters.core.ConverterEnumValue
All Implemented Interfaces:
Serializable, IConverter, IConverterReverse, IResetable
Direct Known Subclasses:
ConverterEnumValueTemplate

public class ConverterEnumValue
extends ConverterNotNullNotEmpty
implements IConverterReverse

Basic enumeration converter, from a text to the corresponding enumeration item. Three arguments are required:

Author:
Thiago Santos.
See Also:
Serialized Form

Field Summary
protected static int ARG_SIZE
          Expected arguments size.
 
Constructor Summary
ConverterEnumValue()
           
 
Method Summary
 Object convert(Object obj, Object[] args)
          Convert a given object to another using some arguments as auxiliary.
protected  Object process(Object obj, Object[] args)
          Process a value.
 Object revert(Object obj, Object[] args)
          Revert a given object to another using some arguments as auxiliary.
 
Methods inherited from class org.specrunner.converters.core.ConverterNotNullNotEmpty
accept
 
Methods inherited from class org.specrunner.converters.core.ConverterDefault
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.specrunner.converters.IConverter
accept
 
Methods inherited from interface org.specrunner.util.reset.IResetable
initialize
 

Field Detail

ARG_SIZE

protected static final int ARG_SIZE
Expected arguments size.

See Also:
Constant Field Values
Constructor Detail

ConverterEnumValue

public ConverterEnumValue()
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 ConverterNotNullNotEmpty
Parameters:
obj - The value to be converted.
args - The arguments.
Returns:
The converted object.
Throws:
ConverterException - On conversion errors.

revert

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

Specified by:
revert in interface IConverterReverse
Parameters:
obj - The value to be reverted.
args - The arguments.
Returns:
The reversible object.
Throws:
ConverterException - On conversion errors.

process

protected Object process(Object obj,
                         Object[] args)
                  throws ConverterException
Process a value.

Parameters:
obj - Value.
args - Arguments.
Returns:
Processed value.
Throws:
ConverterException - On processing errors.


Copyright © 2015. All rights reserved.