|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.instrument.classloading.WeavingTransformer
public class WeavingTransformer
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).
Constructor Summary | |
---|---|
WeavingTransformer()
Create a new WeavingTransformer for the current context class loader. |
|
WeavingTransformer(ClassLoader classLoader)
Create a new WeavingTransformer for the given class loader. |
Method Summary | |
---|---|
void |
addTransformer(ClassFileTransformer transformer)
Add a class file transformer to be applied by this weaver. |
protected ClassLoader |
getDefaultClassLoader()
See ClassUtils. |
byte[] |
transformIfNecessary(String className,
byte[] bytes)
Apply transformation on a given class byte definition. |
byte[] |
transformIfNecessary(String className,
String internalName,
byte[] bytes,
ProtectionDomain pd)
Apply transformation on a given class byte definition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WeavingTransformer()
public WeavingTransformer(ClassLoader classLoader)
classLoader
- the ClassLoader to build a transformer forMethod Detail |
---|
public void addTransformer(ClassFileTransformer transformer)
transformer
- the class file transformer to registerpublic byte[] transformIfNecessary(String className, byte[] bytes)
className
- the full qualified name of the class in dot format (i.e. some.package.SomeClass)bytes
- class byte definition
public byte[] transformIfNecessary(String className, String internalName, byte[] bytes, ProtectionDomain pd)
className
- the full qualified name of the class in dot format (i.e. some.package.SomeClass)internalName
- class name internal name in / format (i.e. some/package/SomeClass)bytes
- class byte definitionpd
- protection domain to be used (can be null)
protected ClassLoader getDefaultClassLoader()
ClassUtils.getDefaultClassLoader()
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |