Package VASSAL.script.expression
Class BeanShellExpression
java.lang.Object
VASSAL.script.expression.Expression
VASSAL.script.expression.BeanShellExpression
A basic beanShell expression
-
Field Summary
FieldsFields inherited from class VASSAL.script.expression.Expression
CACHE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertProperty(String prop)Convert a Property name to its BeanShell equivalent.static ExpressionCreate a BeanShellExpression.static ExpressioncreateExpression(String s, boolean dontCreateStringExpressions)evaluate(PropertySource ps, Map<String,String> properties, boolean localized)Evaluate this expression using a BeanShell InterpretergetFilter(PropertySource ps)Return a PieceFilter that selects GamePieces that cause this expression to evaluate to truestatic Expressionstatic booleanisBeanShellExpression(String expr)protected booleanstatic booleanprotected voidreset()protected static StringOutput a BeanShell equivalent of this expression.Methods inherited from class VASSAL.script.expression.Expression
createPropertyExpression, createSimplePropertyExpression, equals, evaluate, evaluate, evaluate, evaluate, getExpression, getFilter, handleError, hashCode, resetCachedExpressions, setExpression, tryEvaluate, tryEvaluate, tryEvaluate, tryEvaluate, tryEvaluate
-
Field Details
-
interpreter
-
-
Constructor Details
-
BeanShellExpression
-
-
Method Details
-
reset
protected void reset()- Overrides:
resetin classExpression
-
evaluate
public String evaluate(PropertySource ps, Map<String,String> properties, boolean localized) throws ExpressionExceptionEvaluate this expression using a BeanShell Interpreter- Overrides:
evaluatein classExpression- Parameters:
ps- Property Source providing property valuesproperties- default property valueslocalized- localize property calls?- Returns:
- evaluated String.
- Throws:
ExpressionException
-
toBeanShellString
Description copied from class:ExpressionOutput a BeanShell equivalent of this expression.- Overrides:
toBeanShellStringin classExpression- Returns:
- BeanShell equivalent
-
strip
-
isDynamic
protected boolean isDynamic() -
getFilter
Return a PieceFilter that selects GamePieces that cause this expression to evaluate to true- Overrides:
getFilterin classExpression- Parameters:
ps- PropertySource to use as source of filter- Returns:
- Created PieceFilter
-
convertProperty
Convert a Property name to its BeanShell equivalent.- Parameters:
prop- Property name- Returns:
- beanshell equivalent
-
isBeanShellExpression
-
isJavaIdentifier
-
createExpression
Create a BeanShellExpression. The expression may or may not be surrounded by {}. Create null, integer and simple Expressions as their basic type to ensure efficient evaluation. -
createExpression
- Parameters:
s- String to convert to a Beanshell expressionsdontCreateStringExpressions- If True, then convert quoted string to Beanshell Expressions, not String Expressions- Returns:
- Expression
-
instance
-