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 class
Expression.NullExpression
private static class
Expression.PatternPlaceholder
-
Field Summary
Fields Modifier and Type Field Description private int
_offset
the offset of 'this' Expression, as computed for its bytecode by the Java compilerstatic Expression[]
EMPTY_EXPESSIONS
static int
MYSTERY_OFFSET
a constant to indicate that no bytecode offset is known for an expressionstatic Expression
NULL
-
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 protected
Expression(int offset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CastExpression
cast(AstType type)
Expression
clone()
static Expression
forPattern(Pattern pattern)
NodeType
getNodeType()
int
getOffset()
Returns the bytecode offset for 'this' expression.Role<? extends Expression>
getRole()
InvocationExpression
invoke(MethodReference methodReference, Expression... arguments)
InvocationExpression
invoke(MethodReference methodReference, java.lang.Iterable<AstType> typeArguments, Expression... arguments)
InvocationExpression
invoke(MethodReference methodReference, java.lang.Iterable<AstType> typeArguments, java.lang.Iterable<Expression> arguments)
InvocationExpression
invoke(MethodReference methodReference, java.lang.Iterable<Expression> arguments)
InvocationExpression
invoke(Expression... arguments)
InvocationExpression
invoke(java.lang.Iterable<Expression> arguments)
InvocationExpression
invoke(java.lang.String methodName, Expression... arguments)
InvocationExpression
invoke(java.lang.String methodName, java.lang.Iterable<AstType> typeArguments, Expression... arguments)
InvocationExpression
invoke(java.lang.String methodName, java.lang.Iterable<AstType> typeArguments, java.lang.Iterable<Expression> arguments)
InvocationExpression
invoke(java.lang.String methodName, java.lang.Iterable<Expression> arguments)
ReturnStatement
makeReturn()
ThrowStatement
makeThrow()
MemberReferenceExpression
member(FieldReference member)
MemberReferenceExpression
member(java.lang.String memberName)
void
setOffset(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:
getNodeType
in 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()
-
-