public class EvaluateBeanshell extends AbstractNonCacheableEnforcerRule
Modifier and Type | Field and Description |
---|---|
private static bsh.Interpreter |
BSH
Beanshell interpreter.
|
private java.lang.String |
condition
The condition to be evaluated.
|
Constructor and Description |
---|
EvaluateBeanshell() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
evaluateCondition(java.lang.String script,
org.apache.maven.plugin.logging.Log log)
Evaluate expression using Beanshell.
|
void |
execute(EnforcerRuleHelper helper)
This is the interface into the rule.
|
java.lang.String |
getCondition() |
void |
setCondition(java.lang.String condition) |
getCacheId, isCacheable, isResultValid
getLevel, getMessage, setLevel, setMessage
private static final bsh.Interpreter BSH
private java.lang.String condition
#setCondition(String)}
,
#getCondition()}
public final void setCondition(java.lang.String condition)
public final java.lang.String getCondition()
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
EnforcerRule
helper
- The helper provides access to the log, MavenSession and has
helpers to get common components. It is also able to lookup components
by class name.EnforcerRuleException
- the enforcer rule exceptionprotected boolean evaluateCondition(java.lang.String script, org.apache.maven.plugin.logging.Log log) throws EnforcerRuleException
script
- the expression to be evaluatedlog
- the loggerEnforcerRuleException
- if the script could not be evaluated