org.bsf.smartValueObject.tools
Class ASMInstrumentor
java.lang.Object
|
+--org.bsf.smartValueObject.tools.ASMInstrumentor
- All Implemented Interfaces:
- Instrumentor
- public class ASMInstrumentor
- extends java.lang.Object
- implements Instrumentor
ASM specific implementation of Instrumentor. This code is ugly (mainly
due to ASM's low-levelness).
- See Also:
Instrumentor
,
JavaAssistInstrumentor
,
ASM homepage
Field Summary |
private java.lang.String |
className
|
private org.objectweb.asm.ClassWriter |
cw
|
private static org.apache.commons.logging.Log |
log
|
Fields inherited from interface org.bsf.smartValueObject.tools.Instrumentor |
CLEANMETHOD, CREATEDMETHOD, CREATEMETHOD, DELETEDMETHOD, DELETEMETHOD, DIRTYMETHOD, SMARTCOLLECTION, SMARTCONTAINERS, SMARTLIST, SMARTMAP, SMARTSET, VERSIONCLASS, VERSIONFIELD, VERSIONHELPER, VERSIONINTERFACE, VERSIONMETHOD |
Method Summary |
java.lang.Class |
defineClass()
Use internal classloader to build class object.
|
byte[] |
getBytecode()
Get modified class as byte array. |
void |
modifyClass(java.lang.String name)
Modifies this class. |
void |
modifyClass(java.lang.String basedir,
java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.commons.logging.Log log
cw
private org.objectweb.asm.ClassWriter cw
className
private java.lang.String className
ASMInstrumentor
public ASMInstrumentor()
modifyClass
public void modifyClass(java.lang.String name)
throws InstrumentorException
- Description copied from interface:
Instrumentor
- Modifies this class.
- Specified by:
modifyClass
in interface Instrumentor
- Parameters:
name
- class to modify, package notation or filename.
- Throws:
InstrumentorException
- in case of errors
modifyClass
public void modifyClass(java.lang.String basedir,
java.lang.String name)
throws InstrumentorException
- Specified by:
modifyClass
in interface Instrumentor
InstrumentorException
getBytecode
public byte[] getBytecode()
throws InstrumentorException
- Description copied from interface:
Instrumentor
- Get modified class as byte array.
- Specified by:
getBytecode
in interface Instrumentor
- Returns:
- versionable class as bytecode.
- Throws:
InstrumentorException
defineClass
public java.lang.Class defineClass()
- Description copied from interface:
Instrumentor
- Use internal classloader to build class object.
Exists rather for testing purposes, as classes won't be compatible !
- Specified by:
defineClass
in interface Instrumentor
- Returns:
- Versionable class.