Interface IJavaCall
- All Superinterfaces:
IJavaElement
,IJavaExpression
,IJavaStatement
Java AST interface to represent a method invocation. This interface is not used to represent
new-object or new-array creation.
Example:
foo(0, 1, "bar")
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
FLAG_BUILT, FLAG_FIELD_REFERENCES_OUTERCLASS, FLAG_LAMBDA_CLASS, FLAG_LAMBDA_IMPL, FLAG_OPTIONAL_RENDERING, FLAG_SECOND_PARAMETER_IS_OUTER_REF, FLAG_STICKY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Append an argument to this method call.Duplicate this element.getArgument
(int index) int
Get the number of arguments.Retrieve the list of arguments passed to the method.int
Get the method element.Get the original method simple name.Get the original method jvm name (fully qualified canonical name).void
insertArgument
(int index, IJavaExpression arg) Insert an argument to the list of arguments.boolean
boolean
boolean
Determine if the call is to a super-class method.removeArgument
(int index) Pull an argument from the list of arguments.void
setArgument
(int index, IJavaExpression arg) void
setMethod
(IJavaMethod method, int calltype) Set the method to be called.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
addFlags, addTag, canCauseException, collectAllPhysicalOffsets, generate, getData, getElementType, getFlags, getOrigin, getPhysicalMethodIndex, getPhysicalOffset, getReconAnon, getReconEnum, getReconEnummap, getReconLambda, getSubElements, getTags, hasFlags, hasPhysicalMethodIndex, hasPhysicalOffset, isReconArtifact, removeFlags, removeTag, replaceSubElement, setData, setFlags, setLambdaRecon, setOrigin, setPhysicalMethodIndex, setPhysicalOffset, setReconAnon, setReconEnum, setReconEnummap, toShortString, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPre, visitDepthPre, visitDepthPre
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaStatement
getIntermediateOffset, setIntermediateOffset
-
Field Details
-
CALLTYPE_REGULAR
static final int CALLTYPE_REGULAR- See Also:
-
CALLTYPE_SUPER
static final int CALLTYPE_SUPER- See Also:
-
CALLTYPE_LAMBDA
static final int CALLTYPE_LAMBDA- See Also:
-
CALLTYPE_STATIC
static final int CALLTYPE_STATIC- See Also:
-
-
Method Details
-
getMethod
IJavaMethod getMethod()Get the method element.- Returns:
- the method element
-
setMethod
Set the method to be called.- Parameters:
method
- mandatory methodcalltype
- one ofCALLTYPE_xxx
constant
-
getCallType
int getCallType()- Returns:
-
isSuperCall
boolean isSuperCall()Determine if the call is to a super-class method.- Returns:
- true if the method being called is a super-class method
-
isLambdaCall
boolean isLambdaCall()- Returns:
-
isStaticCall
boolean isStaticCall()- Returns:
-
getMethodSignature
String getMethodSignature()Get the original method jvm name (fully qualified canonical name).- Returns:
-
getMethodClass
String getMethodClass()- Returns:
-
getMethodName
String getMethodName()Get the original method simple name.- Returns:
-
getArgumentCount
int getArgumentCount()Get the number of arguments.- Returns:
- the number of arguments
-
getArguments
List<IJavaExpression> getArguments()Retrieve the list of arguments passed to the method.If the method being called is a virtual method, the first argument will be an expression representing the object on which this method is called.
- Returns:
- the list of arguments, the elements in the list cannot be null
-
getArgument
- Parameters:
index
-- Returns:
-
addArgument
Append an argument to this method call.- Parameters:
arg
-
-
insertArgument
Insert an argument to the list of arguments.- Parameters:
index
- 0-based argument indexarg
- mandatory argument to be inserted
-
setArgument
- Parameters:
index
-arg
-
-
removeArgument
Pull an argument from the list of arguments.- Parameters:
index
- 0-based argument index- Returns:
- the argument object that was pulled out
-
duplicate
IJavaCall duplicate()Description copied from interface:IJavaElement
Duplicate this element.- Specified by:
duplicate
in interfaceIJavaElement
- Specified by:
duplicate
in interfaceIJavaExpression
- Specified by:
duplicate
in interfaceIJavaStatement
- Returns:
- a (possibly) duplicated object of the same type
-