Package org.mvel2.ast
Class ASTNode
- java.lang.Object
-
- org.mvel2.ast.ASTNode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
AssertNode,AssignmentNode,BlockNode,BooleanNode,Contains,Convertable,DeclProtoVarNode,DeclTypedVarNode,DeepAssignmentNode,EndOfStatement,Fold,Function,ImportNode,IndexedAssignmentNode,IndexedDeclTypedVarNode,IndexedOperativeAssign,IndexedPostFixDecNode,IndexedPostFixIncNode,IndexedPreFixDecNode,IndexedPreFixIncNode,InlineCollectionNode,Instance,InterceptorWrapper,Invert,IsDef,LineLabel,LiteralDeepPropertyNode,LiteralNode,Negation,NewObjectNode,NewObjectPrototype,NewPrototypeNode,OperativeAssign,OperatorNode,PostFixDecNode,PostFixIncNode,PreFixDecNode,PreFixIncNode,Proto,ProtoVarNode,RegExMatch,RegExMatchNode,ReturnNode,Sign,Soundslike,StaticImportNode,Strsim,Substatement,TypeCast,TypedVarNode,Union
public class ASTNode extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Accessoraccessorstatic intARRAY_TYPE_LITERALstatic intASSIGNstatic intBLOCK_DOstatic intBLOCK_DO_UNTILstatic intBLOCK_FORstatic intBLOCK_FOREACHstatic intBLOCK_IFstatic intBLOCK_UNTILstatic intBLOCK_WHILEstatic intBLOCK_WITHstatic intCOLLECTIONstatic intCOMPILE_IMMEDIATEprotected intcursorPositionstatic intDEEP_PROPERTYstatic intDEFERRED_TYPE_RESstatic intDEOPstatic intDISCARDprotected java.lang.ClassegressTypeprotected intendOfNameprotected char[]exprintfieldsprotected intfirstUnionstatic intFQCNstatic intIDENTIFIERstatic intINLINE_COLLECTIONstatic intINVERTprotected java.lang.Objectliteralstatic intLITERALprotected java.lang.StringnameCacheASTNodenextASTNodestatic intNOJITstatic intNUMERICprotected intoffsetstatic intOPERATORstatic intOPT_SUBTRprotected ParserContextpCtxstatic intPCTX_STOREDprotected AccessorsafeAccessorstatic intSTACKLANGprotected intstartstatic intSTRONG_TYPINGstatic intTHISREF
-
Constructor Summary
Constructors Modifier Constructor Description ASTNode(char[] expr, int start, int offset, int fields, ParserContext pCtx)protectedASTNode(ParserContext pCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanSerializeAccessor()private java.lang.Objectdeop(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory, java.lang.RuntimeException e)voiddiscard()private intgetAbsoluteFirstPart()java.lang.StringgetAbsoluteName()protected java.lang.StringgetAbsoluteRootElement()AccessorgetAccessor()protected java.lang.ClassLoadergetClassLoader()intgetCursorPosition()java.lang.ClassgetEgressType()char[]getExpr()intgetFields()java.lang.ObjectgetLiteralValue()java.lang.StringgetName()char[]getNameAsArray()intgetOffset()java.lang.IntegergetOperator()java.lang.ObjectgetReducedValue(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)java.lang.ObjectgetReducedValueAccelerated(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)intgetStart()booleanisAssignment()protected booleanisCollection()booleanisDebuggingSymbol()booleanisDeepProperty()booleanisDiscard()booleanisFQCN()booleanisIdentifier()booleanisLiteral()booleanisOperator()booleanisOperator(java.lang.Integer operator)booleanisThisVal()private java.lang.Objectoptimize(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)AccessorsetAccessor(Accessor accessor)voidsetAsFQCNReference()voidsetAsLiteral()voidsetCursorPosition(int cursorPosition)voidsetEgressType(java.lang.Class egressType)voidsetLiteralValue(java.lang.Object literal)protected voidsetName(char[] name)voidstoreInLiteralRegister(java.lang.Object o)voidstorePctx()voidstrongTyping()java.lang.StringtoString()
-
-
-
Field Detail
-
LITERAL
public static final int LITERAL
- See Also:
- Constant Field Values
-
DEEP_PROPERTY
public static final int DEEP_PROPERTY
- See Also:
- Constant Field Values
-
OPERATOR
public static final int OPERATOR
- See Also:
- Constant Field Values
-
IDENTIFIER
public static final int IDENTIFIER
- See Also:
- Constant Field Values
-
COMPILE_IMMEDIATE
public static final int COMPILE_IMMEDIATE
- See Also:
- Constant Field Values
-
NUMERIC
public static final int NUMERIC
- See Also:
- Constant Field Values
-
INVERT
public static final int INVERT
- See Also:
- Constant Field Values
-
ASSIGN
public static final int ASSIGN
- See Also:
- Constant Field Values
-
COLLECTION
public static final int COLLECTION
- See Also:
- Constant Field Values
-
THISREF
public static final int THISREF
- See Also:
- Constant Field Values
-
INLINE_COLLECTION
public static final int INLINE_COLLECTION
- See Also:
- Constant Field Values
-
BLOCK_IF
public static final int BLOCK_IF
- See Also:
- Constant Field Values
-
BLOCK_FOREACH
public static final int BLOCK_FOREACH
- See Also:
- Constant Field Values
-
BLOCK_WITH
public static final int BLOCK_WITH
- See Also:
- Constant Field Values
-
BLOCK_UNTIL
public static final int BLOCK_UNTIL
- See Also:
- Constant Field Values
-
BLOCK_WHILE
public static final int BLOCK_WHILE
- See Also:
- Constant Field Values
-
BLOCK_DO
public static final int BLOCK_DO
- See Also:
- Constant Field Values
-
BLOCK_DO_UNTIL
public static final int BLOCK_DO_UNTIL
- See Also:
- Constant Field Values
-
BLOCK_FOR
public static final int BLOCK_FOR
- See Also:
- Constant Field Values
-
OPT_SUBTR
public static final int OPT_SUBTR
- See Also:
- Constant Field Values
-
FQCN
public static final int FQCN
- See Also:
- Constant Field Values
-
STACKLANG
public static final int STACKLANG
- See Also:
- Constant Field Values
-
DEFERRED_TYPE_RES
public static final int DEFERRED_TYPE_RES
- See Also:
- Constant Field Values
-
STRONG_TYPING
public static final int STRONG_TYPING
- See Also:
- Constant Field Values
-
PCTX_STORED
public static final int PCTX_STORED
- See Also:
- Constant Field Values
-
ARRAY_TYPE_LITERAL
public static final int ARRAY_TYPE_LITERAL
- See Also:
- Constant Field Values
-
NOJIT
public static final int NOJIT
- See Also:
- Constant Field Values
-
DEOP
public static final int DEOP
- See Also:
- Constant Field Values
-
DISCARD
public static final int DISCARD
- See Also:
- Constant Field Values
-
firstUnion
protected int firstUnion
-
endOfName
protected int endOfName
-
fields
public int fields
-
egressType
protected java.lang.Class egressType
-
expr
protected char[] expr
-
start
protected int start
-
offset
protected int offset
-
nameCache
protected java.lang.String nameCache
-
literal
protected java.lang.Object literal
-
accessor
protected transient volatile Accessor accessor
-
safeAccessor
protected volatile Accessor safeAccessor
-
cursorPosition
protected int cursorPosition
-
nextASTNode
public ASTNode nextASTNode
-
pCtx
protected ParserContext pCtx
-
-
Constructor Detail
-
ASTNode
protected ASTNode(ParserContext pCtx)
-
ASTNode
public ASTNode(char[] expr, int start, int offset, int fields, ParserContext pCtx)
-
-
Method Detail
-
getReducedValueAccelerated
public java.lang.Object getReducedValueAccelerated(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)
-
deop
private java.lang.Object deop(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory, java.lang.RuntimeException e)
-
optimize
private java.lang.Object optimize(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)
-
getReducedValue
public java.lang.Object getReducedValue(java.lang.Object ctx, java.lang.Object thisValue, VariableResolverFactory factory)
-
getAbsoluteRootElement
protected java.lang.String getAbsoluteRootElement()
-
getEgressType
public java.lang.Class getEgressType()
-
setEgressType
public void setEgressType(java.lang.Class egressType)
-
getNameAsArray
public char[] getNameAsArray()
-
getAbsoluteFirstPart
private int getAbsoluteFirstPart()
-
getAbsoluteName
public java.lang.String getAbsoluteName()
-
getName
public java.lang.String getName()
-
getLiteralValue
public java.lang.Object getLiteralValue()
-
storeInLiteralRegister
public void storeInLiteralRegister(java.lang.Object o)
-
setLiteralValue
public void setLiteralValue(java.lang.Object literal)
-
setName
protected void setName(char[] name)
-
isIdentifier
public boolean isIdentifier()
-
isLiteral
public boolean isLiteral()
-
isThisVal
public boolean isThisVal()
-
isOperator
public boolean isOperator()
-
isOperator
public boolean isOperator(java.lang.Integer operator)
-
getOperator
public java.lang.Integer getOperator()
-
isCollection
protected boolean isCollection()
-
isAssignment
public boolean isAssignment()
-
isDeepProperty
public boolean isDeepProperty()
-
isFQCN
public boolean isFQCN()
-
setAsLiteral
public void setAsLiteral()
-
setAsFQCNReference
public void setAsFQCNReference()
-
getCursorPosition
public int getCursorPosition()
-
setCursorPosition
public void setCursorPosition(int cursorPosition)
-
isDiscard
public boolean isDiscard()
-
discard
public void discard()
-
strongTyping
public void strongTyping()
-
storePctx
public void storePctx()
-
isDebuggingSymbol
public boolean isDebuggingSymbol()
-
getFields
public int getFields()
-
getAccessor
public Accessor getAccessor()
-
canSerializeAccessor
public boolean canSerializeAccessor()
-
getStart
public int getStart()
-
getOffset
public int getOffset()
-
getExpr
public char[] getExpr()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getClassLoader
protected java.lang.ClassLoader getClassLoader()
-
-