BEAST
eu.baltrad.beast.rules.groovy.GroovyRule Class Reference
Inheritance diagram for eu.baltrad.beast.rules.groovy.GroovyRule:
eu.baltrad.beast.rules.IRule

Public Member Functions

String getType ()
 
boolean isValid ()
 
void setScriptableRule (IScriptableRule rule)
 To be able to set a precompiled groovy rule.
 
IBltMessage handle (IBltMessage message)
 
void setScript (String script)
 Creates an instance of the groovy script.
 
String getScript ()
 
int getState ()
 
Throwable getThrowable ()
 

Static Public Attributes

static final int UNITIALIZED = -1
 Rule has not got any script set.
 
static final int OK = 0
 Rule is ok.
 
static final int COMPILATION_ERROR = 1
 Rule could not be compiled.
 
static final int INSTANTIATION_EXCEPTION = 2
 Rule coult not be instantiated.
 
static final int ILLEGAL_ACCESS_EXCEPTION = 3
 Access problems.
 
static final int CLASS_CAST_EXCEPTION = 4
 Class cast exception, probably not implementing IScriptableRule.
 
static final int THROWABLE = 5
 Any type of throwable causing a failure.
 
static final String TYPE = "groovy"
 The type name of this rule.
 

Protected Member Functions

 GroovyRule ()
 Default constructor, however use manager for creation.
 
Class parseClass (String code)
 Parses code into a class.
 

Detailed Description

Author
Anders Henja

Constructor & Destructor Documentation

◆ GroovyRule()

eu.baltrad.beast.rules.groovy.GroovyRule.GroovyRule ( )
inlineprotected

Default constructor, however use manager for creation.

Member Function Documentation

◆ getScript()

String eu.baltrad.beast.rules.groovy.GroovyRule.getScript ( )
inline
Returns
the groovy script as a string

◆ getState()

int eu.baltrad.beast.rules.groovy.GroovyRule.getState ( )
inline
Returns
the state

◆ getThrowable()

Throwable eu.baltrad.beast.rules.groovy.GroovyRule.getThrowable ( )
inline
Returns
the exception if any occured during compilation

◆ getType()

String eu.baltrad.beast.rules.groovy.GroovyRule.getType ( )
inline

◆ handle()

IBltMessage eu.baltrad.beast.rules.groovy.GroovyRule.handle ( IBltMessage message)
inline

◆ isValid()

boolean eu.baltrad.beast.rules.groovy.GroovyRule.isValid ( )
inline

◆ parseClass()

Class eu.baltrad.beast.rules.groovy.GroovyRule.parseClass ( String code)
inlineprotected

Parses code into a class.

Parameters
codethe code to parse
Returns
a class

◆ setScript()

void eu.baltrad.beast.rules.groovy.GroovyRule.setScript ( String script)
inline

Creates an instance of the groovy script.

Must be implementing the IScriptableRule. Will compile and validate the script.

Parameters
scriptthe script to set
Exceptions
RuleExceptionif the script could not be set

◆ setScriptableRule()

void eu.baltrad.beast.rules.groovy.GroovyRule.setScriptableRule ( IScriptableRule rule)
inline

To be able to set a precompiled groovy rule.

Parameters
rulethe rule to set

Member Data Documentation

◆ CLASS_CAST_EXCEPTION

final int eu.baltrad.beast.rules.groovy.GroovyRule.CLASS_CAST_EXCEPTION = 4
static

Class cast exception, probably not implementing IScriptableRule.

◆ COMPILATION_ERROR

final int eu.baltrad.beast.rules.groovy.GroovyRule.COMPILATION_ERROR = 1
static

Rule could not be compiled.

◆ ILLEGAL_ACCESS_EXCEPTION

final int eu.baltrad.beast.rules.groovy.GroovyRule.ILLEGAL_ACCESS_EXCEPTION = 3
static

Access problems.

◆ INSTANTIATION_EXCEPTION

final int eu.baltrad.beast.rules.groovy.GroovyRule.INSTANTIATION_EXCEPTION = 2
static

Rule coult not be instantiated.

◆ OK

final int eu.baltrad.beast.rules.groovy.GroovyRule.OK = 0
static

Rule is ok.

◆ THROWABLE

final int eu.baltrad.beast.rules.groovy.GroovyRule.THROWABLE = 5
static

Any type of throwable causing a failure.

◆ TYPE

final String eu.baltrad.beast.rules.groovy.GroovyRule.TYPE = "groovy"
static

The type name of this rule.

◆ UNITIALIZED

final int eu.baltrad.beast.rules.groovy.GroovyRule.UNITIALIZED = -1
static

Rule has not got any script set.


The documentation for this class was generated from the following file: