Class Expression
- java.lang.Object
-
- com.strobel.core.Freezable
-
- com.strobel.decompiler.languages.java.ast.AstNode
-
- com.strobel.decompiler.languages.java.ast.Expression
-
- All Implemented Interfaces:
UserDataStore,IFreezable,INode,java.lang.Cloneable
- Direct Known Subclasses:
Annotation,ArrayCreationExpression,ArrayInitializerExpression,AssignmentExpression,BinaryOperatorExpression,BytecodeConstant,CastExpression,ClassOfExpression,ConditionalExpression,Expression.NullExpression,Expression.PatternPlaceholder,IdentifierExpression,IndexerExpression,InlinedBytecodeExpression,InvocationExpression,LambdaExpression,MemberReferenceExpression,MethodGroupExpression,NullReferenceExpression,ObjectCreationExpression,ParenthesizedExpression,PatternExpression,PrimitiveExpression,SuperReferenceExpression,SwitchExpression,ThisReferenceExpression,TypeReferenceExpression,UnaryOperatorExpression
public abstract class Expression extends AstNode
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classExpression.NullExpressionprivate static classExpression.PatternPlaceholder
-
Field Summary
Fields Modifier and Type Field Description private int_offsetthe offset of 'this' Expression, as computed for its bytecode by the Java compilerstatic Expression[]EMPTY_EXPESSIONSstatic intMYSTERY_OFFSETa constant to indicate that no bytecode offset is known for an expressionstatic ExpressionNULL-
Fields inherited from class com.strobel.decompiler.languages.java.ast.AstNode
AST_NODE_USED_FLAGS, flags, FROZEN_BIT, ROLE_INDEX_MASK, ROOT_ROLE
-
Fields inherited from interface com.strobel.decompiler.patterns.INode
CHILD_ITERATOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedExpression(int offset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CastExpressioncast(AstType type)Expressionclone()static ExpressionforPattern(Pattern pattern)NodeTypegetNodeType()intgetOffset()Returns the bytecode offset for 'this' expression.Role<? extends Expression>getRole()InvocationExpressioninvoke(MethodReference methodReference, Expression... arguments)InvocationExpressioninvoke(MethodReference methodReference, java.lang.Iterable<AstType> typeArguments, Expression... arguments)InvocationExpressioninvoke(MethodReference methodReference, java.lang.Iterable<AstType> typeArguments, java.lang.Iterable<Expression> arguments)InvocationExpressioninvoke(MethodReference methodReference, java.lang.Iterable<Expression> arguments)InvocationExpressioninvoke(Expression... arguments)InvocationExpressioninvoke(java.lang.Iterable<Expression> arguments)InvocationExpressioninvoke(java.lang.String methodName, Expression... arguments)InvocationExpressioninvoke(java.lang.String methodName, java.lang.Iterable<AstType> typeArguments, Expression... arguments)InvocationExpressioninvoke(java.lang.String methodName, java.lang.Iterable<AstType> typeArguments, java.lang.Iterable<Expression> arguments)InvocationExpressioninvoke(java.lang.String methodName, java.lang.Iterable<Expression> arguments)ReturnStatementmakeReturn()ThrowStatementmakeThrow()MemberReferenceExpressionmember(FieldReference member)MemberReferenceExpressionmember(java.lang.String memberName)voidsetOffset(int offset)Sets the bytecode offset for 'this' expression.-
Methods inherited from class com.strobel.decompiler.languages.java.ast.AstNode
acceptVisitor, addChild, addChildUnsafe, contains, contains, copyUserDataFrom, debugToString, freezeCore, getAncestors, getAncestors, getAncestorsAndSelf, getChildByRole, getChildren, getChildrenByRole, getDescendants, getDescendantsAndSelf, getEndLocation, getFirstChild, getLastChild, getNextNode, getNextSibling, getNextSibling, getParent, getParent, getPreviousNode, getPreviousSibling, getPreviousSibling, getRegion, getStartLocation, getText, getText, getUserData, hasChildren, insertChildAfter, insertChildBefore, insertChildBeforeUnsafe, insertChildrenAfter, insertChildrenBefore, isAncestorOf, isAncestorOf, isDescendantOf, isInside, isInside, isLoop, isNull, isReference, isUnconditionalBranch, makeOptional, match, matches, matches, matchesCollection, matchString, putUserData, putUserDataIfAbsent, remove, replace, replaceWith, replaceWith, setChildByRole, setRole, setRoleUnsafe, toString, withName
-
Methods inherited from class com.strobel.core.Freezable
canFreeze, freeze, freezeIfUnfrozen, isFrozen, tryFreeze, verifyFrozen, verifyNotFrozen
-
-
-
-
Field Detail
-
EMPTY_EXPESSIONS
public static final Expression[] EMPTY_EXPESSIONS
-
NULL
public static final Expression NULL
-
MYSTERY_OFFSET
public static final int MYSTERY_OFFSET
a constant to indicate that no bytecode offset is known for an expression- See Also:
- Constant Field Values
-
_offset
private int _offset
the offset of 'this' Expression, as computed for its bytecode by the Java compiler
-
-
Method Detail
-
getOffset
public int getOffset()
Returns the bytecode offset for 'this' expression.
-
setOffset
public void setOffset(int offset)
Sets the bytecode offset for 'this' expression.
-
clone
public Expression clone()
-
getNodeType
public NodeType getNodeType()
- Specified by:
getNodeTypein classAstNode
-
getRole
public Role<? extends Expression> getRole()
-
forPattern
public static Expression forPattern(Pattern pattern)
-
invoke
public InvocationExpression invoke(Expression... arguments)
-
invoke
public InvocationExpression invoke(java.lang.Iterable<Expression> arguments)
-
invoke
public InvocationExpression invoke(java.lang.String methodName, Expression... arguments)
-
invoke
public InvocationExpression invoke(java.lang.String methodName, java.lang.Iterable<Expression> arguments)
-
invoke
public InvocationExpression invoke(java.lang.String methodName, java.lang.Iterable<AstType> typeArguments, Expression... arguments)
-
invoke
public InvocationExpression invoke(java.lang.String methodName, java.lang.Iterable<AstType> typeArguments, java.lang.Iterable<Expression> arguments)
-
invoke
public InvocationExpression invoke(MethodReference methodReference, Expression... arguments)
-
invoke
public InvocationExpression invoke(MethodReference methodReference, java.lang.Iterable<Expression> arguments)
-
invoke
public InvocationExpression invoke(MethodReference methodReference, java.lang.Iterable<AstType> typeArguments, Expression... arguments)
-
invoke
public InvocationExpression invoke(MethodReference methodReference, java.lang.Iterable<AstType> typeArguments, java.lang.Iterable<Expression> arguments)
-
member
public MemberReferenceExpression member(java.lang.String memberName)
-
member
public MemberReferenceExpression member(FieldReference member)
-
cast
public CastExpression cast(AstType type)
-
makeReturn
public ReturnStatement makeReturn()
-
makeThrow
public ThrowStatement makeThrow()
-
-