org.specrunner.util.expression
Interface IAbstraction

All Known Subinterfaces:
INodeHolder
All Known Implementing Classes:
CellAdapter, NodeHolderDefault, RowAdapter, TableAdapter

public interface IAbstraction

Stands for any object which can be evaluate.

Author:
Thiago Santos

Field Summary
static Boolean DEFAULT_EVAL_ARGS
          Default is not eval arguments.
static String FEATURE_EVAL_ARGS
          Feature to eval arguments.
 
Method Summary
 List<String> getArguments()
          Get element arguments in a array.
 List<String> getArguments(List<String> arguments)
          Get element arguments in a array.
 IComparator getComparator()
          Get the comparator of the given element.
 IComparator getComparator(IComparator comparatorDefault)
          Get the comparator of the given element.
 IConverter getConverter()
          Get the converter.
 IConverter getConverter(IConverter converterDefault)
          Get the converter, if any, otherwise returns the default converter.
 IFormatter getFormatter()
          Get the abstraction formatter.
 IFormatter getFormatter(IFormatter formatterDefault)
          Get the abstraction formatter.
 List<String> getFormatterArguments()
          Get formatter attributes.
 List<String> getFormatterArguments(List<String> arguments)
          Get formatter arguments.
 Object getObject(IContext context, boolean silent)
          Gets the corresponding value object.
 Object getObject(IContext context, boolean silent, IConverter converter, List<String> arguments)
          Gets the corresponding value object.
 IReader getReader()
          Get reader object.
 IReader getReader(IReader readerDefault)
          Get reader object or default if not found.
 String getValue(IContext context)
          Get element value.
 String getValue(IContext context, Object[] args)
          Get element value.
 

Field Detail

FEATURE_EVAL_ARGS

static final String FEATURE_EVAL_ARGS
Feature to eval arguments.


DEFAULT_EVAL_ARGS

static final Boolean DEFAULT_EVAL_ARGS
Default is not eval arguments.

Method Detail

getValue

String getValue(IContext context)
Get element value.

Parameters:
context - The test context.
Returns:
Element value.

getValue

String getValue(IContext context,
                Object[] args)
Get element value.

Parameters:
context - The test context.
args - Arguments to return value.
Returns:
Element value.

getReader

IReader getReader()
                  throws ReaderException
Get reader object.

Returns:
A reader.
Throws:
ReaderException - On reader load error.

getReader

IReader getReader(IReader readerDefault)
                  throws ReaderException
Get reader object or default if not found.

Parameters:
readerDefault - The default reader.
Returns:
A reader.
Throws:
ReaderException - On reader load error.

getConverter

IConverter getConverter()
                        throws ConverterException
Get the converter.

Returns:
A converter.
Throws:
ConverterException - On converter lookup error.

getConverter

IConverter getConverter(IConverter converterDefault)
                        throws ConverterException
Get the converter, if any, otherwise returns the default converter.

Parameters:
converterDefault - The default converter.
Returns:
A converter.
Throws:
ConverterException - On converter lookup error.

getArguments

List<String> getArguments()
Get element arguments in a array.

Returns:
The list of values set for 'arg0', 'arg1',... 'argN'.

getArguments

List<String> getArguments(List<String> arguments)
Get element arguments in a array.

Parameters:
arguments - The default arguments in case of not found.
Returns:
The list of values set for 'arg0', 'arg1',... 'argN'.

getComparator

IComparator getComparator()
                          throws ComparatorException
Get the comparator of the given element.

Returns:
The element comparator.
Throws:
ComparatorException - O comparator lookup errors.

getComparator

IComparator getComparator(IComparator comparatorDefault)
                          throws ComparatorException
Get the comparator of the given element.

Parameters:
comparatorDefault - The default comparator.
Returns:
The element comparator.
Throws:
ComparatorException - O comparator lookup errors.

getFormatterArguments

List<String> getFormatterArguments()
Get formatter attributes.

Returns:
Formatter attributes.

getFormatterArguments

List<String> getFormatterArguments(List<String> arguments)
Get formatter arguments.

Parameters:
arguments - Default list of arguments.
Returns:
A list of arguments.

getFormatter

IFormatter getFormatter()
                        throws FormatterException
Get the abstraction formatter.

Returns:
A formatter if it exists, null, otherwise.
Throws:
FormatterException - On formatter lookup error.

getFormatter

IFormatter getFormatter(IFormatter formatterDefault)
                        throws FormatterException
Get the abstraction formatter.

Parameters:
formatterDefault - Default formatter.
Returns:
A formatter if it exists, default otherwise.
Throws:
FormatterException - On formatter lookup error.

getObject

Object getObject(IContext context,
                 boolean silent)
                 throws PluginException
Gets the corresponding value object.

Parameters:
context - The context.
silent - Flag to evaluate silently or not.
Returns:
The value object.
Throws:
PluginException - On plugin errors.

getObject

Object getObject(IContext context,
                 boolean silent,
                 IConverter converter,
                 List<String> arguments)
                 throws PluginException
Gets the corresponding value object.

Parameters:
context - The context.
silent - Flag to evaluate silently or not.
converter - The converter.
arguments - The arguments.
Returns:
The value object.
Throws:
PluginException - On plugin errors.


Copyright © 2015. All rights reserved.