|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjef.disconnection.impl.DefaultMethodDisconnector
public class DefaultMethodDisconnector
Default implementation of the MethodDisconnector
interface.
Constructor Summary | |
---|---|
DefaultMethodDisconnector()
Creates a new instance of DefaultMethodDisconnector |
Method Summary | |
---|---|
void |
extract(MethodInfoStructure methodInfo,
Dna srcDna,
DisconnectedMethod disconnectedMethod)
This method copies into the disconnectedMethod instance provided as parameter
the given methodInfo object. |
protected CodeAttribute |
handleAttributes(MethodInfoStructure clonedMethodInfo,
boolean isInit)
|
protected void |
handleBytecode(CodeAttribute codeAttribute,
DisconnectedMethod disconnectedMethod,
ConstantPoolTable srcCpt,
Dna srcDna)
|
protected CodeAttribute |
handleCodeAttribute(Attribute attr,
boolean isInit)
|
protected void |
handleDeprecatedAttribute(DeprecatedAttribute attr)
|
protected void |
handleExceptionAttribute(ExceptionsAttribute attr)
|
protected void |
handleFieldOrMethodRef(DisconnectedMethod dm,
Dna srcDna,
ConstantPoolTable srcCpt,
int oldRef,
int newRef,
Instruction instruction)
|
protected void |
handleFirstLevelRefs(MethodInfoStructure clonedMethodInfo,
boolean isInit,
DisconnectedMethod dm,
Dna srcDna)
|
protected void |
handleInnerClassRef(ConstClass cInfo,
DisconnectedMethod dm,
Dna srcDna)
|
protected void |
handleLineNumberTableAttribute(LineNumberTableAttribute attr,
boolean isInit)
|
protected void |
handleLocalVariableTableAttribute(LocalVariableTableAttribute attr,
boolean isInit)
|
protected void |
handleSyntheticAttribute(SyntheticAttribute attr)
|
protected void |
innerExtract(MethodInfoStructure methodInfo,
Dna srcDna,
DisconnectedMethod disconnectedMethod)
Protected extraction method. |
protected void |
innerExtractInit(MethodInfoStructure methodInfo,
Dna srcDna,
DisconnectedMethod disconnectedMethod)
|
protected FieldInfoStructure |
searchField(Dna dna,
int nameIndex,
int descIndex)
This method searches over the provided Dna instance for a field having the
given nameIndex and descriptorIndex . |
protected MethodInfoStructure |
searchMethod(Dna dna,
int nameIndex,
int descIndex)
This method searches over the provided Dna instance for a method having the
given nameIndex and descriptorIndex . |
protected void |
spawnNewInnerClass(DisconnectedMethod dm,
java.lang.String fqicn)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultMethodDisconnector()
Method Detail |
---|
public void extract(MethodInfoStructure methodInfo, Dna srcDna, DisconnectedMethod disconnectedMethod) throws DisconnectionFailedException
disconnectedMethod
instance provided as parameter
the given methodInfo
object. Actually this is a real copy, that is the source
methodInfo
gets cloned and all its references to cp_info
s
entries are correctly updated.Dna
to a target
DisconnectedMethod
data structure entails that a deep copy of all the
referenced cp_info
s will be launched. This is a required step to bring into
the target DisconnectedMethod
all the other information on which the method
definition is based.DeepCopier
instance.
extract
in interface MethodDisconnector
methodInfo
- The reference to the method to be copied into the target
disconnectMethod
srcDna
- The Dna
instance the methodInfo
belongs todisconnectedMethod
- The target DisconnectedMethod
instance in which the disconnected
method will be stored for a subsequent injection
DisconnectionFailedException
protected void innerExtract(MethodInfoStructure methodInfo, Dna srcDna, DisconnectedMethod disconnectedMethod) throws DisconnectionFailedException
methodInfo
- The reference to the method to be copied into the target
disconnectMethod
srcDna
- The Dna
instance the methodInfo
belongs todisconnectMethod
- The target DisconnectedMethod
instance in which the disconnected
method will be stored for a subsequent injectiondstDna
- The target Dna
instance the disconnected method will
be attached to
DisconnectionFailedException
protected void handleFirstLevelRefs(MethodInfoStructure clonedMethodInfo, boolean isInit, DisconnectedMethod dm, Dna srcDna) throws DeepCopyException, java.lang.CloneNotSupportedException, DisconnectionFailedException
DeepCopyException
java.lang.CloneNotSupportedException
DisconnectionFailedException
protected CodeAttribute handleAttributes(MethodInfoStructure clonedMethodInfo, boolean isInit) throws DeepCopyException, java.lang.CloneNotSupportedException
DeepCopyException
java.lang.CloneNotSupportedException
protected CodeAttribute handleCodeAttribute(Attribute attr, boolean isInit) throws DeepCopyException, java.lang.CloneNotSupportedException
DeepCopyException
java.lang.CloneNotSupportedException
protected void handleLineNumberTableAttribute(LineNumberTableAttribute attr, boolean isInit) throws DeepCopyException, java.lang.CloneNotSupportedException
DeepCopyException
java.lang.CloneNotSupportedException
protected void handleLocalVariableTableAttribute(LocalVariableTableAttribute attr, boolean isInit) throws DeepCopyException, java.lang.CloneNotSupportedException
DeepCopyException
java.lang.CloneNotSupportedException
protected void handleExceptionAttribute(ExceptionsAttribute attr) throws DeepCopyException, java.lang.CloneNotSupportedException
DeepCopyException
java.lang.CloneNotSupportedException
protected void handleSyntheticAttribute(SyntheticAttribute attr) throws DeepCopyException, java.lang.CloneNotSupportedException
DeepCopyException
java.lang.CloneNotSupportedException
protected void handleDeprecatedAttribute(DeprecatedAttribute attr) throws DeepCopyException, java.lang.CloneNotSupportedException
DeepCopyException
java.lang.CloneNotSupportedException
protected void handleBytecode(CodeAttribute codeAttribute, DisconnectedMethod disconnectedMethod, ConstantPoolTable srcCpt, Dna srcDna) throws DisconnectionFailedException, DeepCopyException, java.lang.CloneNotSupportedException, InstantiatorException
DisconnectionFailedException
DeepCopyException
java.lang.CloneNotSupportedException
InstantiatorException
protected void handleFieldOrMethodRef(DisconnectedMethod dm, Dna srcDna, ConstantPoolTable srcCpt, int oldRef, int newRef, Instruction instruction) throws DisconnectionFailedException
DisconnectionFailedException
protected void handleInnerClassRef(ConstClass cInfo, DisconnectedMethod dm, Dna srcDna) throws java.lang.CloneNotSupportedException, InstantiatorException, DeepCopyException
java.lang.CloneNotSupportedException
InstantiatorException
DeepCopyException
protected void spawnNewInnerClass(DisconnectedMethod dm, java.lang.String fqicn)
protected void innerExtractInit(MethodInfoStructure methodInfo, Dna srcDna, DisconnectedMethod disconnectedMethod) throws DisconnectionFailedException
DisconnectionFailedException
protected FieldInfoStructure searchField(Dna dna, int nameIndex, int descIndex)
Dna
instance for a field having the
given nameIndex
and descriptorIndex
. If found, the first
matching field is returned, otherwise null
will be the expected return value.
dna
- The Dna
instance to be inspectednameIndex
- The nameIndex
of the fielddescIndex
- The descIndex
of the field
null
otherwiseprotected MethodInfoStructure searchMethod(Dna dna, int nameIndex, int descIndex)
Dna
instance for a method having the
given nameIndex
and descriptorIndex
. If found, the first
matching method is returned, otherwise null
will be the expected return value.
dna
- The Dna
instance to be inspectednameIndex
- The nameIndex
of the fielddescIndex
- The descIndex
of the field
null
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |