public final class JexlFeatures extends Object
#pragma x y
->
for lambdas as in x -> x + x
=>
for lambdas as in x => x + x
#pragma jexl.namespace.ns namespace
syntax is allowed#pragma jexl.import fully.qualified.class.name
syntax is allowedgt
for >,
lt
for <, ...)Modifier and Type | Field and Description |
---|---|
static int |
ANNOTATION
Annotation feature ordinal.
|
static int |
ARRAY_REF_EXPR
Array get is allowed on expr.
|
static int |
COMPARATOR_NAMES
Comparator names (legacy) syntax.
|
static int |
FAT_ARROW
Fat-arrow lambda syntax.
|
static int |
IMPORT_PRAGMA
Import pragma feature ordinal.
|
static int |
LAMBDA
Lambda feature ordinal.
|
static int |
LEXICAL
Lexical feature ordinal.
|
static int |
LEXICAL_SHADE
Lexical shade feature ordinal.
|
static int |
LOCAL_VAR
Locals feature ordinal.
|
static int |
LOOP
Loops feature ordinal.
|
static int |
METHOD_CALL
Lambda feature ordinal.
|
static int |
NEW_INSTANCE
New-instance feature ordinal.
|
static int |
NS_PRAGMA
Namespace pragma feature ordinal.
|
static int |
PRAGMA
Pragma feature ordinal.
|
static int |
PRAGMA_ANYWHERE
The pragma anywhere feature ordinal.
|
static int |
RESERVED
Reserved name feature ordinal.
|
static int |
SCRIPT
Script feature ordinal.
|
static int |
SIDE_EFFECT
Side effects feature ordinal.
|
static int |
SIDE_EFFECT_GLOBAL
Global side-effects feature ordinal.
|
static int |
STRUCTURED_LITERAL
Structured literal feature ordinal.
|
static Predicate<String> |
TEST_STR_FALSE
The false predicate.
|
static int |
THIN_ARROW
Fat-arrow lambda syntax.
|
Constructor and Description |
---|
JexlFeatures()
Creates an all-features-enabled instance.
|
JexlFeatures(JexlFeatures features)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
JexlFeatures |
annotation(boolean flag)
Sets whether annotation constructs are enabled.
|
JexlFeatures |
arrayReferenceExpr(boolean flag)
Sets whether array references expressions are enabled.
|
JexlFeatures |
comparatorNames(boolean flag)
Sets whether the legacy comparison operator names syntax is enabled.
|
boolean |
equals(Object obj) |
JexlFeatures |
fatArrow(boolean flag)
Sets whether fat-arrow lambda syntax is enabled.
|
Set<String> |
getReservedNames() |
int |
hashCode() |
JexlFeatures |
importPragma(boolean flag)
Sets whether import pragma constructs are enabled.
|
boolean |
isLexical() |
boolean |
isLexicalShade() |
boolean |
isReservedName(String name)
Checks whether a name is reserved.
|
JexlFeatures |
lambda(boolean flag)
Sets whether lambda/function constructs are enabled.
|
JexlFeatures |
lexical(boolean flag)
Sets whether syntactic lexical mode is enabled.
|
JexlFeatures |
lexicalShade(boolean flag)
Sets whether syntactic lexical shade is enabled.
|
JexlFeatures |
localVar(boolean flag)
Sets whether local variables are enabled.
|
JexlFeatures |
loops(boolean flag)
Sets whether looping constructs are enabled.
|
JexlFeatures |
methodCall(boolean flag)
Sets whether method calls expressions are enabled.
|
JexlFeatures |
namespacePragma(boolean flag)
Sets whether namespace pragma constructs are enabled.
|
Predicate<String> |
namespaceTest() |
JexlFeatures |
namespaceTest(Predicate<String> names)
Sets a test to determine namespace declaration.
|
JexlFeatures |
newInstance(boolean flag)
Sets whether creating new instances is enabled.
|
JexlFeatures |
pragma(boolean flag)
Sets whether pragma constructs are enabled.
|
JexlFeatures |
pragmaAnywhere(boolean flag)
Sets whether pragma constructs can appear anywhere in the code.
|
JexlFeatures |
register(boolean flag)
Sets whether register are enabled.
|
JexlFeatures |
reservedNames(Collection<String> names)
Sets a collection of reserved names precluding those to be used as local variables or parameter names.
|
JexlFeatures |
script(boolean flag)
Sets whether scripts constructs are enabled.
|
JexlFeatures |
sideEffect(boolean flag)
Sets whether side effect expressions are enabled.
|
JexlFeatures |
sideEffectGlobal(boolean flag)
Sets whether side effect expressions on global variables (aka non-local) are enabled.
|
static String |
stringify(int feature)
The text corresponding to a feature code.
|
JexlFeatures |
structuredLiteral(boolean flag)
Sets whether array/map/set literal expressions are enabled.
|
boolean |
supportsAnnotation() |
boolean |
supportsArrayReferenceExpr() |
boolean |
supportsComparatorNames() |
boolean |
supportsExpression() |
boolean |
supportsFatArrow() |
boolean |
supportsImportPragma() |
boolean |
supportsLambda() |
boolean |
supportsLocalVar() |
boolean |
supportsLoops() |
boolean |
supportsMethodCall() |
boolean |
supportsNamespacePragma() |
boolean |
supportsNewInstance() |
boolean |
supportsPragma() |
boolean |
supportsPragmaAnywhere() |
boolean |
supportsRegister() |
boolean |
supportsScript() |
boolean |
supportsSideEffect() |
boolean |
supportsSideEffectGlobal() |
boolean |
supportsStructuredLiteral() |
boolean |
supportsThinArrow() |
JexlFeatures |
thinArrow(boolean flag)
Sets whether thin-arrow lambda syntax is enabled.
|
public static final Predicate<String> TEST_STR_FALSE
public static final int RESERVED
public static final int LOCAL_VAR
public static final int SIDE_EFFECT
public static final int SIDE_EFFECT_GLOBAL
public static final int ARRAY_REF_EXPR
public static final int NEW_INSTANCE
public static final int LOOP
public static final int LAMBDA
public static final int METHOD_CALL
public static final int STRUCTURED_LITERAL
public static final int PRAGMA
public static final int ANNOTATION
public static final int SCRIPT
public static final int LEXICAL
public static final int LEXICAL_SHADE
public static final int THIN_ARROW
public static final int FAT_ARROW
public static final int NS_PRAGMA
public static final int IMPORT_PRAGMA
public static final int COMPARATOR_NAMES
public static final int PRAGMA_ANYWHERE
public JexlFeatures()
public JexlFeatures(JexlFeatures features)
features
- the feature to copy frompublic static String stringify(int feature)
feature
- the feature numberpublic JexlFeatures reservedNames(Collection<String> names)
names
- the names to reservepublic Set<String> getReservedNames()
public boolean isReservedName(String name)
name
- the name to checkpublic JexlFeatures namespaceTest(Predicate<String> names)
names
- the name predicatepublic Predicate<String> namespaceTest()
public JexlFeatures register(boolean flag)
This is mostly used internally during execution of JexlEngine.{g,s}etProperty.
When disabled, parsing a script/expression using the register syntax will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsRegister()
public JexlFeatures localVar(boolean flag)
When disabled, parsing a script/expression using a local variable or parameter syntax will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsLocalVar()
public JexlFeatures sideEffectGlobal(boolean flag)
When disabled, parsing a script/expression using syntactical constructs modifying variables including all potentially ant-ish variables will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsSideEffectGlobal()
public JexlFeatures sideEffect(boolean flag)
When disabled, parsing a script/expression using syntactical constructs modifying variables or members will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsSideEffect()
public JexlFeatures arrayReferenceExpr(boolean flag)
When disabled, parsing a script/expression using 'obj[ ref ]' where ref is not a string or integer literal will throw a parsing exception;
flag
- true to enable, false to disablepublic boolean supportsArrayReferenceExpr()
public JexlFeatures methodCall(boolean flag)
When disabled, parsing a script/expression using 'obj.method()' will throw a parsing exception;
flag
- true to enable, false to disablepublic boolean supportsMethodCall()
public JexlFeatures structuredLiteral(boolean flag)
When disabled, parsing a script/expression creating one of these literals will throw a parsing exception;
flag
- true to enable, false to disablepublic boolean supportsStructuredLiteral()
public JexlFeatures newInstance(boolean flag)
When disabled, parsing a script/expression using 'new(...)' will throw a parsing exception; using a class as functor will fail at runtime.
flag
- true to enable, false to disablepublic boolean supportsNewInstance()
public JexlFeatures loops(boolean flag)
When disabled, parsing a script/expression using syntactic looping constructs (for,while) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsLoops()
public JexlFeatures lambda(boolean flag)
When disabled, parsing a script/expression using syntactic lambda constructs (->,function) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsLambda()
public JexlFeatures thinArrow(boolean flag)
When disabled, parsing a script/expression using syntactic thin-arrow (-<) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsThinArrow()
public JexlFeatures fatArrow(boolean flag)
When disabled, parsing a script/expression using syntactic fat-arrow (=<) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsFatArrow()
public JexlFeatures comparatorNames(boolean flag)
When disabled, comparison operators names (eq;ne;le;lt;ge;gt) will be treated as plain identifiers.
flag
- true to enable, false to disablepublic boolean supportsComparatorNames()
public JexlFeatures pragma(boolean flag)
When disabled, parsing a script/expression using syntactic pragma constructs (#pragma) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsPragma()
public JexlFeatures pragmaAnywhere(boolean flag)
flag
- true to enable, false to disablepublic boolean supportsPragmaAnywhere()
public JexlFeatures namespacePragma(boolean flag)
When disabled, parsing a script/expression using syntactic namespace pragma constructs (#pragma jexl.namespace....) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsNamespacePragma()
public JexlFeatures importPragma(boolean flag)
When disabled, parsing a script/expression using syntactic import pragma constructs (#pragma jexl.import....) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsImportPragma()
public JexlFeatures annotation(boolean flag)
When disabled, parsing a script/expression using syntactic annotation constructs (@annotation) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsAnnotation()
public JexlFeatures script(boolean flag)
When disabled, parsing a script using syntactic script constructs (statements, ...) will throw a parsing exception.
flag
- true to enable, false to disablepublic boolean supportsScript()
public boolean supportsExpression()
public JexlFeatures lexical(boolean flag)
flag
- true means syntactic lexical function scope is in effect, false implies non-lexical scopingpublic boolean isLexical()
public JexlFeatures lexicalShade(boolean flag)
flag
- true means syntactic lexical shade is in effect and implies lexical scopepublic boolean isLexicalShade()
Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.