Package org.mvel2.compiler
Class PropertyVerifier
java.lang.Object
org.mvel2.compiler.AbstractParser
org.mvel2.optimizers.AbstractOptimizer
org.mvel2.compiler.PropertyVerifier
- All Implemented Interfaces:
Serializable
,Parser
This verifier is used by the compiler to enforce rules such as type strictness. It is, as side-effect, also
responsible for extracting type information.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private static final int
private Class
private boolean
private static final int
private boolean
private boolean
private static final int
private boolean
private static final int
private boolean
private static final int
Fields inherited from class org.mvel2.optimizers.AbstractOptimizer
BEAN, collection, currType, nullSafe, staticAccess, tkStart
Fields inherited from class org.mvel2.compiler.AbstractParser
CLASS_LITERALS, compileMode, cursor, debugSymbols, dStack, end, expr, fields, GET, GET_OR_CREATE, greedy, lastLineStart, lastNode, lastWasComment, lastWasIdentifier, lastWasLineLabel, length, LEVEL_0_PROPERTY_ONLY, LEVEL_1_BASIC_LANG, LEVEL_2_MULTI_STATEMENT, LEVEL_3_ITERATION, LEVEL_4_ASSIGNMENT, LEVEL_5_CONTROL_FLOW, line, literalOnly, LITERALS, OP_CONTINUE, OP_NOT_LITERAL, OP_OVERFLOW, OP_RESET_FRAME, OP_TERMINATE, OPERATORS, pCtx, REMOVE, SET, splitAccumulator, st, start, stk, variableFactory
-
Constructor Summary
ConstructorsConstructorDescriptionPropertyVerifier
(char[] property, int start, int offset, ParserContext parserContext) PropertyVerifier
(char[] property, ParserContext parserContext) PropertyVerifier
(String property, ParserContext parserContext) PropertyVerifier
(String property, ParserContext parserContext, Class root) -
Method Summary
Modifier and TypeMethodDescriptionanalyze()
Analyze the statement and return the known egress type.private Class
getBeanProperty
(Class ctx, String property) Process bean propertyprivate Class
getCollectionProperty
(Class ctx, String property) Process collection propertygetCtx()
private Class
Process methodprivate Class
getReturnType
(Class context, Method m) private Class
getWithProperty
(Class ctx) boolean
boolean
boolean
isFqcn()
boolean
isInput()
boolean
boolean
private void
recordParametricReturnedType
(Type parametricReturnType) private void
recordTypeParmsForProperty
(String property) private Class
<?> void
void
private static Class
<?> type2Class
(Type type) Methods inherited from class org.mvel2.optimizers.AbstractOptimizer
capture, findLastUnion, nextSubToken, scanTo, tryStaticAccess, whiteSpaceSkip
Methods inherited from class org.mvel2.compiler.AbstractParser
addFatalError, addFatalError, arithmeticFunctionReduction, captureIdentifier, captureToEOS, captureToEOSorEOL, captureToEOT, captureToNextTokenJunction, expectEOS, expectNextChar_IW, getCursor, getExpression, handleSubstatement, handleUnion, ifThenElseBlockContinues, incNextNonBlank, isArithmeticOperator, isNextIdentifier, isNextIdentifierOrLiteral, isStatementNotManuallyTerminated, lastNonWhite, loadLanguageFeaturesByLevel, lookAhead, lookAhead, lookBehind, lookToLast, nextNonBlank, nextToken, nextTokenSkipSymbols, reduce, setExpression, setExpression, setLanguageLevel, setupParser, skipWhitespace, tokenContinues, trimLeft, trimRight, trimWhitespace
-
Field Details
-
DONE
private static final int DONE- See Also:
-
NORM
private static final int NORM- See Also:
-
METH
private static final int METH- See Also:
-
COL
private static final int COL- See Also:
-
WITH
private static final int WITH- See Also:
-
inputs
-
first
private boolean first -
classLiteral
private boolean classLiteral -
resolvedExternally
private boolean resolvedExternally -
methodCall
private boolean methodCall -
deepProperty
private boolean deepProperty -
fqcn
private boolean fqcn -
paramTypes
-
ctx
-
-
Constructor Details
-
PropertyVerifier
-
PropertyVerifier
-
PropertyVerifier
-
PropertyVerifier
-
-
Method Details
-
getInputs
-
setInputs
-
analyze
Analyze the statement and return the known egress type.- Returns:
- known engress type
-
recordTypeParmsForProperty
-
getBeanProperty
Process bean property- Parameters:
ctx
- - the ingress typeproperty
- - the property component- Returns:
- known egress type.
-
getReturnType
-
recordParametricReturnedType
-
returnGenericType
-
getCollectionProperty
Process collection property- Parameters:
ctx
- - the ingress typeproperty
- - the property component- Returns:
- known egress type
-
getMethod
Process method- Parameters:
ctx
- - the ingress typename
- - the property component- Returns:
- known egress type.
-
type2Class
-
getWithProperty
-
isResolvedExternally
public boolean isResolvedExternally() -
isClassLiteral
public boolean isClassLiteral() -
isDeepProperty
public boolean isDeepProperty() -
isInput
public boolean isInput() -
isMethodCall
public boolean isMethodCall() -
isFqcn
public boolean isFqcn() -
getCtx
-
setCtx
-