|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.shrikeBT.MethodData
public final class MethodData
This class is a container for a bunch of information that we might know about a method. It's here for convenience so users can just pass one MethodData around instead of passing around an array of instructions, an array of exception handler lists, etc. It also provides a place to hang annotations. We provide a table mapping abstract "keys" to annotation objects. We also provide an invalidation protocol so that the annotation objects can be notified of code changes and react appropriately. This is useful for caching analysis results for a method.
| Nested Class Summary | |
|---|---|
static interface |
MethodData.Results
Annotation objects implement this Results interface. |
| Constructor Summary | |
|---|---|
MethodData(Decoder d,
int access,
java.lang.String classType,
java.lang.String name,
java.lang.String signature)
Gather the information for a method after it has been decoded. |
|
MethodData(int access,
java.lang.String classType,
java.lang.String name,
java.lang.String signature,
IInstruction[] instructions,
ExceptionHandler[][] handlers,
int[] instructionsToBytecodes)
Gather the information for a method "from scratch". |
|
| Method Summary | |
|---|---|
int |
getAccess()
|
java.lang.String |
getClassType()
|
ExceptionHandler[][] |
getHandlers()
|
boolean |
getHasChanged()
|
MethodData.Results |
getInfo(java.lang.Object key)
Get the annotation for the given key. |
IInstruction[] |
getInstructions()
|
int[] |
getInstructionsToBytecodes()
|
boolean |
getIsStatic()
|
boolean |
getIsSynchronized()
|
java.lang.String |
getName()
|
java.lang.String |
getSignature()
|
static MethodData |
makeWithDefaultHandlersAndInstToBytecodes(int access,
java.lang.String classType,
java.lang.String name,
java.lang.String signature,
IInstruction[] instructions)
Create information for a method, with no exception handlers and a dummy mapping of instructions to original bytecodes. |
void |
putInfo(java.lang.Object key,
MethodData.Results value)
Set the annotation for the given key. |
void |
setHasChanged()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MethodData(int access,
java.lang.String classType,
java.lang.String name,
java.lang.String signature,
IInstruction[] instructions,
ExceptionHandler[][] handlers,
int[] instructionsToBytecodes)
access - the access flagsclassType - the class in which the method is defined, in JVM type format (e.g., Ljava/lang/Object;)name - the method namesignature - the method signature, in JVM type format (e.g., (ILjava/lang/Object;)V)instructions - the instructions making up the methodhandlers - a list of exception handlers for each instructioninstructionsToBytecodes - a map stating, for each instruction, the offset of the original bytecode instruction(s) giving
rise to this instruction
public MethodData(Decoder d,
int access,
java.lang.String classType,
java.lang.String name,
java.lang.String signature)
throws java.lang.NullPointerException
d - the decoder which has decoded the methodaccess - the access flagsclassType - the class in which the method is defined, in JVM type format (e.g., Ljava/lang/Object;)name - the method namesignature - the method signature, in JVM type format (e.g., (ILjava/lang/Object;)V)
java.lang.NullPointerException - if d is null| Method Detail |
|---|
public static MethodData makeWithDefaultHandlersAndInstToBytecodes(int access,
java.lang.String classType,
java.lang.String name,
java.lang.String signature,
IInstruction[] instructions)
access - the access flagsclassType - the class in which the method is defined, in JVM type format (e.g., Ljava/lang/Object;)name - the method namesignature - the method signature, in JVM type format (e.g., (ILjava/lang/Object;)V)instructions - the instructions making up the methodpublic void setHasChanged()
public java.lang.String getSignature()
public java.lang.String getName()
public int getAccess()
public java.lang.String getClassType()
public boolean getIsStatic()
public boolean getIsSynchronized()
public ExceptionHandler[][] getHandlers()
public IInstruction[] getInstructions()
public int[] getInstructionsToBytecodes()
public MethodData.Results getInfo(java.lang.Object key)
public void putInfo(java.lang.Object key,
MethodData.Results value)
public boolean getHasChanged()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||