org.specrunner.runner.core
Class FilterDefault

java.lang.Object
  extended by org.specrunner.runner.core.FilterDefault
All Implemented Interfaces:
IFilter

public class FilterDefault
extends Object
implements IFilter

Default filter by alias type, and by action type.

Author:
Thiago Santos

Field Summary
protected  List<String> disabledAliases
          List of disabled aliases.
protected  List<? extends ActionType> disabledTypes
          List of disabled types.
protected  List<String> enabledAliases
          List of enabled aliases.
protected  List<? extends ActionType> enabledTypes
          List of enabled types.
static String FEATURE_DISABLED_ALIASES
          Feature to set the disabled aliases using IFeatureManager or IConfiguration.
static String FEATURE_DISABLED_TYPES
          Feature to set the disabled type using IFeatureManager or IConfiguration.
static String FEATURE_ENABLED_ALIASES
          Feature to set the enabled aliases using IFeatureManager or IConfiguration.
static String FEATURE_ENABLED_TYPES
          Feature to set the enabled types using IFeatureManager or IConfiguration.
static ThreadLocal<FilterDefault> INSTANCE
          Thread safe filter instance.
protected  boolean showMessage
          Show message on error.
 
Constructor Summary
FilterDefault()
           
 
Method Summary
 boolean accept(IBlock block)
          Check if a given block is accepted.
 List<String> getDisabledAliases()
          Get the list of disabled aliases.
 List<? extends ActionType> getDisabledTypes()
          Get the list of disabled types.
 List<String> getEnabledAliases()
          Get the list of enabled aliases.
 List<? extends ActionType> getEnabledTypes()
          Get the list of enabled types.
 void initialize(IContext context)
          Inicialize filter.
 boolean isShowMessage()
          Indicate runner to show message on not accepted blocks.
 void setDisabledAliases(List<String> disabledAliases)
          List of alias that should be ignored by runner.
 void setDisabledTypes(List<? extends ActionType> disabledTypes)
          List of action types that should be ignored by runner.
 void setEnabledAliases(List<String> enabledAliases)
          List of alias that should be enabled by runner.
 void setEnabledTypes(List<? extends ActionType> enabledTypes)
          List of action types that should be enabled by runner.
 void setShowMessage(boolean showMessage)
          Set the message status.
 boolean showMessage(IBlock block)
          Indicates to show message if not accepted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEATURE_DISABLED_ALIASES

public static final String FEATURE_DISABLED_ALIASES
Feature to set the disabled aliases using IFeatureManager or IConfiguration.


FEATURE_ENABLED_ALIASES

public static final String FEATURE_ENABLED_ALIASES
Feature to set the enabled aliases using IFeatureManager or IConfiguration.


FEATURE_DISABLED_TYPES

public static final String FEATURE_DISABLED_TYPES
Feature to set the disabled type using IFeatureManager or IConfiguration.


FEATURE_ENABLED_TYPES

public static final String FEATURE_ENABLED_TYPES
Feature to set the enabled types using IFeatureManager or IConfiguration.


INSTANCE

public static final ThreadLocal<FilterDefault> INSTANCE
Thread safe filter instance.


disabledAliases

protected List<String> disabledAliases
List of disabled aliases.


enabledAliases

protected List<String> enabledAliases
List of enabled aliases.


disabledTypes

protected List<? extends ActionType> disabledTypes
List of disabled types.


enabledTypes

protected List<? extends ActionType> enabledTypes
List of enabled types.


showMessage

protected boolean showMessage
Show message on error.

Constructor Detail

FilterDefault

public FilterDefault()
Method Detail

setDisabledAliases

public void setDisabledAliases(List<String> disabledAliases)
List of alias that should be ignored by runner.

Parameters:
disabledAliases - The alias to be ignored by runner.

getDisabledAliases

public List<String> getDisabledAliases()
Get the list of disabled aliases.

Returns:
Disabled aliases list.

setEnabledAliases

public void setEnabledAliases(List<String> enabledAliases)
List of alias that should be enabled by runner.

Parameters:
enabledAliases - The alias to be enabled by runner.

getEnabledAliases

public List<String> getEnabledAliases()
Get the list of enabled aliases.

Returns:
Enabled aliases list.

setDisabledTypes

public void setDisabledTypes(List<? extends ActionType> disabledTypes)
List of action types that should be ignored by runner.

Parameters:
disabledTypes - The types to be ignored by runner.

getDisabledTypes

public List<? extends ActionType> getDisabledTypes()
Get the list of disabled types.

Returns:
Disabled types list.

setEnabledTypes

public void setEnabledTypes(List<? extends ActionType> enabledTypes)
List of action types that should be enabled by runner.

Parameters:
enabledTypes - The types to be enabled by runner.

getEnabledTypes

public List<? extends ActionType> getEnabledTypes()
Get the list of enabled types.

Returns:
Enabled types list.

isShowMessage

public boolean isShowMessage()
Indicate runner to show message on not accepted blocks.

Returns:
true, to show message, false, otherwise.

setShowMessage

public void setShowMessage(boolean showMessage)
Set the message status.

Parameters:
showMessage - The message flag.

initialize

public void initialize(IContext context)
Description copied from interface: IFilter
Inicialize filter.

Specified by:
initialize in interface IFilter
Parameters:
context - The context.

accept

public boolean accept(IBlock block)
Description copied from interface: IFilter
Check if a given block is accepted.

Specified by:
accept in interface IFilter
Parameters:
block - The block to test.
Returns:
true, if block is accepted, false, otherwise.

showMessage

public boolean showMessage(IBlock block)
Description copied from interface: IFilter
Indicates to show message if not accepted.

Specified by:
showMessage in interface IFilter
Parameters:
block - The block.
Returns:
true, if block must show message, false , otherwise.


Copyright © 2014. All rights reserved.