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 intLambda implementation call.static final intRegular virtual or direct call.static final intStatic method call.static final intSuper-class method call.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 TypeMethodDescriptionvoidAppend an argument to this method call.Duplicate this element.getArgument(int index) Retrieve an argument by index.intGet the number of arguments.Retrieve the list of arguments passed to the method.intRetrieve the call type.Get the method element.Retrieve the signature of the method owner class.Get the original method simple name.Get the original method jvm name (fully qualified canonical name).voidinsertArgument(int index, IJavaExpression arg) Insert an argument to the list of arguments.booleanDetermine whether the call represents a lambda implementation call.booleanDetermine whether the call is static.booleanDetermine if the call is to a super-class method.removeArgument(int index) Pull an argument from the list of arguments.voidsetArgument(int index, IJavaExpression arg) Replace an argument.voidsetMethod(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, visitDepthPreMethods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaStatement
getIntermediateOffset, setIntermediateOffset
-
Field Details
-
CALLTYPE_REGULAR
static final int CALLTYPE_REGULARRegular virtual or direct call.- See Also:
-
CALLTYPE_SUPER
static final int CALLTYPE_SUPERSuper-class method call.- See Also:
-
CALLTYPE_LAMBDA
static final int CALLTYPE_LAMBDALambda implementation call.- See Also:
-
CALLTYPE_STATIC
static final int CALLTYPE_STATICStatic method call.- 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_xxxconstant
-
getCallType
int getCallType()Retrieve the call type.- Returns:
- one of the
CALLTYPE_xxxconstants
-
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()Determine whether the call represents a lambda implementation call.- Returns:
- true if this call is a lambda call
-
isStaticCall
boolean isStaticCall()Determine whether the call is static.- Returns:
- true if this call is static
-
getMethodSignature
String getMethodSignature()Get the original method jvm name (fully qualified canonical name).- Returns:
- the method signature
-
getMethodClass
String getMethodClass()Retrieve the signature of the method owner class.- Returns:
- the method owner class signature
-
getMethodName
String getMethodName()Get the original method simple name.- Returns:
- the method simple name
-
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
Retrieve an argument by index.- Parameters:
index- 0-based argument index- Returns:
- the argument expression
-
addArgument
Append an argument to this method call.- Parameters:
arg- mandatory argument to append
-
insertArgument
Insert an argument to the list of arguments.- Parameters:
index- 0-based argument indexarg- mandatory argument to be inserted
-
setArgument
Replace an argument.- Parameters:
index- 0-based argument indexarg- mandatory replacement argument
-
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:IJavaElementDuplicate this element.- Specified by:
duplicatein interfaceIJavaElement- Specified by:
duplicatein interfaceIJavaExpression- Specified by:
duplicatein interfaceIJavaStatement- Returns:
- a (possibly) duplicated object of the same type
-