org.cesta.trans.java
Class ValidateStateTransitions

java.lang.Object
  extended by org.cesta.trans.AbstractTransformation
      extended by org.cesta.trans.java.AbstractRewriteTransformation
          extended by org.cesta.trans.java.ValidateStateTransitions
All Implemented Interfaces:
Transformation

public class ValidateStateTransitions
extends AbstractRewriteTransformation

Transformation, which can check state transitions in class according to rules defined in GraphViz's DOT language.

Parameters:

NameTypeDefaultDescription
stateSetter String "setState" name of function to set state
stateSetterArg String "newState" name of argument in state setter
stateGetter String "getState" name of function to get state
stateConstants String (regexp) "STATE_.*" name of state constants
allowedFunctions String (regexp) "" name of functions, that should be always allowed
ignoredFunctions String (regexp) "" name of functions, that should be completely ignored

Basic parameters are inherited from AbstractRewriteTransformation.

Author:
Tobias Smolka

Field Summary
protected  DotTree.Graph graph
           
 
Fields inherited from class org.cesta.trans.java.AbstractRewriteTransformation
tokens, tree
 
Fields inherited from class org.cesta.trans.AbstractTransformation
logger
 
Constructor Summary
ValidateStateTransitions()
           
 
Method Summary
 void execute()
          Main entry point of the transformation
 java.util.Map<java.lang.String,java.lang.Object> getDefaultParams()
          Returns default parameters
 DotTree.Graph getGraph()
           
 void loadDotGraph()
          Loads given DOT graph.
 void setGraph(DotTree.Graph graph)
           
 void transform(MappedFile filePair)
          Transforms single file
 
Methods inherited from class org.cesta.trans.java.AbstractRewriteTransformation
prepareTreeNodeStream, registerTemplateGroupLoader
 
Methods inherited from class org.cesta.trans.AbstractTransformation
addMappedFile, clearParams, getMappedFiles, getParam, getParam, getParamB, getParamB, getParams, getParamS, getParamS, setMappedFiles, setParam, setParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected DotTree.Graph graph
Constructor Detail

ValidateStateTransitions

public ValidateStateTransitions()
Method Detail

setGraph

public void setGraph(DotTree.Graph graph)

getGraph

public DotTree.Graph getGraph()

transform

public void transform(MappedFile filePair)
               throws TransformationException
Transforms single file

Specified by:
transform in class AbstractRewriteTransformation
Parameters:
filePair - File pair (input/output) to transform
Throws:
TransformationException - In case transformation failed

loadDotGraph

public void loadDotGraph()
                  throws TransformationException
Loads given DOT graph.

Throws:
TransformationException - in case that graph could not be loaded and parsed

execute

public void execute()
             throws TransformationException
Description copied from class: AbstractRewriteTransformation
Main entry point of the transformation

Specified by:
execute in interface Transformation
Overrides:
execute in class AbstractRewriteTransformation
Throws:
TransformationException - In case transformation failed

getDefaultParams

public java.util.Map<java.lang.String,java.lang.Object> getDefaultParams()
Returns default parameters

Overrides:
getDefaultParams in class AbstractRewriteTransformation
Returns:
map of parameters