| java.lang.Object org.springframework.instrument.classloading.WeavingTransformer
WeavingTransformer | public class WeavingTransformer (Code) | | ClassFileTransformer-based weaver, allowing for a list of transformers to be
applied on a class byte array. Normally used inside class loaders.
Note: This class is deliberately implemented for minimal external dependencies,
since it is included in weaver jars (to be deployed into application servers).
author: Rod Johnson author: Costin Leau author: Juergen Hoeller since: 2.0 |
Method Summary | |
public void | addTransformer(ClassFileTransformer transformer) Add a class file transformer to be applied by this weaver. | protected ClassLoader | getDefaultClassLoader() See ClassUtils. | public byte[] | transformIfNecessary(String className, byte[] bytes) Apply transformation on a given class byte definition.
The method will always return a non-null byte array (if no transformation has taken place
the array content will be identical to the original one).
Parameters: className - the full qualified name of the class in dot format (i.e. | public byte[] | transformIfNecessary(String className, String internalName, byte[] bytes, ProtectionDomain pd) Apply transformation on a given class byte definition.
The method will always return a non-null byte array (if no transformation has taken place
the array content will be identical to the original one).
Parameters: className - the full qualified name of the class in dot format (i.e. |
WeavingTransformer | public WeavingTransformer()(Code) | | Create a new WeavingTransformer for the current context class loader.
|
WeavingTransformer | public WeavingTransformer(ClassLoader classLoader)(Code) | | Create a new WeavingTransformer for the given class loader.
Parameters: classLoader - the ClassLoader to build a transformer for |
addTransformer | public void addTransformer(ClassFileTransformer transformer)(Code) | | Add a class file transformer to be applied by this weaver.
Parameters: transformer - the class file transformer to register |
transformIfNecessary | public byte[] transformIfNecessary(String className, byte[] bytes)(Code) | | Apply transformation on a given class byte definition.
The method will always return a non-null byte array (if no transformation has taken place
the array content will be identical to the original one).
Parameters: className - the full qualified name of the class in dot format (i.e. some.package.SomeClass) Parameters: bytes - class byte definition (possibly transformed) class byte definition |
transformIfNecessary | public byte[] transformIfNecessary(String className, String internalName, byte[] bytes, ProtectionDomain pd)(Code) | | Apply transformation on a given class byte definition.
The method will always return a non-null byte array (if no transformation has taken place
the array content will be identical to the original one).
Parameters: className - the full qualified name of the class in dot format (i.e. some.package.SomeClass) Parameters: internalName - class name internal name in / format (i.e. some/package/SomeClass) Parameters: bytes - class byte definition Parameters: pd - protection domain to be used (can be null) (possibly transformed) class byte definition |
|
|