Package com.tonic.analysis.callgraph
Class CallSite
- java.lang.Object
-
- com.tonic.analysis.callgraph.CallSite
-
public class CallSite extends Object
A specific location where one method invokes another, with the invoke type and bytecode offset.
-
-
Constructor Summary
Constructors Constructor Description CallSite(MethodReference caller, MethodReference target, InvokeType invokeType)Creates a call site with no known bytecode offset.CallSite(MethodReference caller, MethodReference target, InvokeType invokeType, int bytecodeOffset)Creates a call site at a known bytecode offset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetBytecodeOffset()MethodReferencegetCaller()InvokeTypegetInvokeType()MethodReferencegetTarget()inthashCode()booleanisDynamic()booleanisPolymorphic()booleanisSpecial()booleanisStatic()StringtoString()
-
-
-
Constructor Detail
-
CallSite
public CallSite(MethodReference caller, MethodReference target, InvokeType invokeType)
Creates a call site with no known bytecode offset.- Parameters:
caller- the invoking methodtarget- the invoked methodinvokeType- the kind of invocation
-
CallSite
public CallSite(MethodReference caller, MethodReference target, InvokeType invokeType, int bytecodeOffset)
Creates a call site at a known bytecode offset.- Parameters:
caller- the invoking methodtarget- the invoked methodinvokeType- the kind of invocationbytecodeOffset- the offset of the invoke instruction, or -1 if unknown
-
-
Method Detail
-
getCaller
public MethodReference getCaller()
- Returns:
- the caller
-
getTarget
public MethodReference getTarget()
- Returns:
- the target
-
getInvokeType
public InvokeType getInvokeType()
- Returns:
- the invoke type
-
getBytecodeOffset
public int getBytecodeOffset()
- Returns:
- the bytecode offset
-
isPolymorphic
public boolean isPolymorphic()
- Returns:
- true if this is a virtual/interface call that may have multiple targets
-
isStatic
public boolean isStatic()
- Returns:
- true if this is a static call
-
isSpecial
public boolean isSpecial()
- Returns:
- true if this is a special (constructor/super/private) call
-
isDynamic
public boolean isDynamic()
- Returns:
- true if this is an invokedynamic call
-
-