Package com.googlecode.aviator
Enum Class Options
- All Implemented Interfaces:
Serializable
,Comparable<Options>
,Constable
Aviator Evaluator Configuration options.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAllowed java class set in new statement and class's static method(fields) etc.When true, always parsing floating-point number into BigDecial, default is false.It replacesinvalid reference
#ALWAYS_USE_DOUBLE_AS_DECIMAL
When true, always parsing integral number into BigDecial, default is false.Allowed assignable java class set in new statement and class's static method(fields) etc.Whether to capture the function arguments(at invocation) into env, the argument list will be stored in __args__ variable in env valid for function body.Enable property access syntax sugar, use common-beantuils to access property such as "a.b.c" etc.Script engine evaluate mode, default is ASM mode.The expression execution timeout value in milliseconds.AviatorScript engine feature set, seeFeature
Math context for decimal, default isinvalid reference
MathContext.DECIMAL128
Max loop count to prevent too much CPU consumption.When enable property access syntax sugar, returns nil if the property value is not found or throws exception.Default value is false,disabled this behaviour.Optimize level, default isAviatorEvaluator.EVAL
Whether to put capturing groups into passed-in env map when regular-expression pattern matches, default is true.If you don't want the groups, you can turn it off to get better performance in regular-expression pattern matching.Whether the compiled expression is serializable.Whether to trace expression evaluating procedure, default is false.Whether to use user passed-in env as top level environment directly.If true, it may make side effects(such as assignment) to user passed-in env., otherwise aviator will wrap the user passed-in env and does not make any side effects into it. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Options.Value
static final Options.Value
static final Options.Value
static final Options.Value
static final Options.Value
private static final Options.Value
static final Options.Value
static final Options.Value
static Options.Value
private static final boolean
static final Options.Value
static final Options.Value
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Options.Value
Returns the default value of option.Returns the default value object of option.private static Options.Value
intoObject
(Options.Value val) Cast value union into java object.Cast java object into value union.boolean
isValidValue
(Object val) static Options
Returns the enum constant of this class with the specified name.static Options[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OPTIMIZE_LEVEL
Optimize level, default isAviatorEvaluator.EVAL
- See Also:
-
MATH_CONTEXT
Math context for decimal, default isinvalid reference
MathContext.DECIMAL128
- See Also:
-
ALWAYS_PARSE_FLOATING_POINT_NUMBER_INTO_DECIMAL
When true, always parsing floating-point number into BigDecial, default is false.It replacesinvalid reference
#ALWAYS_USE_DOUBLE_AS_DECIMAL
-
ALWAYS_PARSE_INTEGRAL_NUMBER_INTO_DECIMAL
When true, always parsing integral number into BigDecial, default is false.- Since:
- 4.2.0
-
TRACE_EVAL
Whether to trace expression evaluating procedure, default is false. -
PUT_CAPTURING_GROUPS_INTO_ENV
Whether to put capturing groups into passed-in env map when regular-expression pattern matches, default is true.If you don't want the groups, you can turn it off to get better performance in regular-expression pattern matching. -
CAPTURE_FUNCTION_ARGS
Whether to capture the function arguments(at invocation) into env, the argument list will be stored in __args__ variable in env valid for function body. Default is false(disabled).- Since:
- 4.2.0
-
ENABLE_PROPERTY_SYNTAX_SUGAR
Enable property access syntax sugar, use common-beantuils to access property such as "a.b.c" etc. Default value is true, enable this behaviour. -
NIL_WHEN_PROPERTY_NOT_FOUND
When enable property access syntax sugar, returns nil if the property value is not found or throws exception.Default value is false,disabled this behaviour. -
USE_USER_ENV_AS_TOP_ENV_DIRECTLY
Whether to use user passed-in env as top level environment directly.If true, it may make side effects(such as assignment) to user passed-in env., otherwise aviator will wrap the user passed-in env and does not make any side effects into it. Default is true. -
MAX_LOOP_COUNT
Max loop count to prevent too much CPU consumption. If it's value is zero or negative, it means no limitation on loop count.Default is zero. -
FEATURE_SET
AviatorScript engine feature set, seeFeature
- Since:
- 5.
-
ALLOWED_CLASS_SET
Allowed java class set in new statement and class's static method(fields) etc. It's null by default. Null ALLOWED_CLASS_SET and ASSIGNABLE_ALLOWED_CLASS_SET means all classes are allowed (default); Empty ALLOWED_CLASS_SET or ASSIGNABLE_ALLOWED_CLASS_SET means forbidding all classes.- Since:
- 5.2.2
-
ASSIGNABLE_ALLOWED_CLASS_SET
Allowed assignable java class set in new statement and class's static method(fields) etc. It's null by default. Null ALLOWED_CLASS_SET and ASSIGNABLE_ALLOWED_CLASS_SET means all classes are allowed (default); Empty ALLOWED_CLASS_SET or ASSIGNABLE_ALLOWED_CLASS_SET means forbidding all classes. -
EVAL_MODE
Script engine evaluate mode, default is ASM mode. -
SERIALIZABLE
Whether the compiled expression is serializable. If true, the compiled expression will implementinvalid reference
jva.io.Serializable
-
EVAL_TIMEOUT_MS
The expression execution timeout value in milliseconds. If the execution time exceeds this value, it will throw aTimeoutException
. A value of zero or less indicates no timeout limitation, the default value is zero (no limitation).
Note: this limitation is not strict and may hurt performance, it is only checked before:- Operator evaluating, such as add, sub etc.
- Jumping in branches, such as loop and conditional clauses etc.
- Function invocation
- Since:
- 5.4.2
-
-
Field Details
-
FALSE_VALUE
-
TRUE_VALUE
-
ZERO_VALUE
-
DEFAULT_MATH_CONTEXT
-
EVAL_VALUE
-
COMPILE_VALUE
-
FULL_FEATURE_SET
-
TRACE_EVAL_DEFAULT_VAL
private static final boolean TRACE_EVAL_DEFAULT_VAL -
ASM_MODE
-
INTERPRETER_MODE
-
NULL_CLASS_SET
-
SYS_EVAL_MODE
-
-
Constructor Details
-
Options
private Options()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
intoObject
Cast value union into java object.- Parameters:
val
-- Returns:
-
intoValue
Cast java object into value union.- Parameters:
val
-- Returns:
-
isValidValue
-
getDefaultValue
Returns the default value of option.- Returns:
-
getDefaultValueObject
Returns the default value object of option.- Returns:
-
getDefaultEvalMode
-
getSystemEvalMode
-