Note
This class is deliberately implemented for minimal external dependencies, since it is included in weaver jars (to be deployed into application servers).
| Modifier and Type | Field and Description |
|---|---|
| private final ClassLoader | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | WeavingTransformer(ClassLoader
the ClassLoader to build a transformer for classLoader)Create a new WeavingTransformer for the given class loader. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addTransformer(ClassFileTransformer
the class file transformer to register transformer)Add a class file transformer to be applied by this weaver. |
| public byte[] | Returns: (possibly transformed) class byte definitionthe full qualified name of the class in dot format (i.e. some.package.SomeClass) className, byte[] class byte definition bytes)Apply transformation on a given class byte definition. |
| public byte[] | Returns: (possibly transformed) class byte definitionthe full qualified name of the class in dot format (i.e. some.package.SomeClass) className, String class name internal name in / format (i.e. some/package/SomeClass) internalName, byte[] class byte definition bytes, ProtectionDomain protection domain to be used (can be pd)null)Apply transformation on a given class byte definition. |
| classLoader | back to summary |
|---|---|
| private final ClassLoader classLoader
| |
| transformers | back to summary |
|---|---|
| private final List<ClassFileTransformer> transformers | |
| WeavingTransformer | back to summary |
|---|---|
| public WeavingTransformer(ClassLoader classLoader) Create a new WeavingTransformer for the given class loader.
| |
| addTransformer | back to summary |
|---|---|
| public void addTransformer(ClassFileTransformer transformer) Add a class file transformer to be applied by this weaver.
| |
| transformIfNecessary | back to summary |
|---|---|
| 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).
| |
| transformIfNecessary | back to summary |
|---|---|
| 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).
| |