public class Manipulator extends Object
| Constructor and Description |
|---|
Manipulator(ClassLoader loader) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMethodToInnerClass(String name,
MethodDescriptor md)
Adds a method to an inner class.
|
static String |
extractInnerClassName(String clazz)
Extracts the inner class simple name from the qualified name.
|
int |
getClassVersion() |
Map<String,String> |
getFields() |
Set<String> |
getFinalFields() |
Collection<String> |
getInnerClasses() |
Map<String,List<MethodDescriptor>> |
getInnerClassesAndMethods() |
org.apache.felix.ipojo.metadata.Element |
getManipulationMetadata()
Compute component type manipulation metadata.
|
List<MethodDescriptor> |
getMethods() |
List<MethodDescriptor> |
getMethodsFromInnerClass(String innerClassInternalName) |
boolean |
isAlreadyManipulated()
Checks whether the class was already manipulated.
|
byte[] |
manipulate(byte[] origin)
Manipulate the given byte array.
|
byte[] |
manipulateInnerClass(String inner,
byte[] bytecode)
Manipulates the inner class.
|
void |
prepare(byte[] origin)
Checks the given bytecode, determines if the class was already manipulated, and collect the metadata about the
class.
|
void |
prepareInnerClass(String inner,
byte[] bytecode)
Analyzes the given inner class.
|
static String |
toQualifiedName(String clazz) |
public Manipulator(ClassLoader loader)
public void prepare(byte[] origin)
throws IOException
origin - the bytecodeIOExceptionpublic byte[] manipulate(byte[] origin)
throws IOException
origin - : original class.IOException - : if an error occurs during the manipulation.public boolean isAlreadyManipulated()
true if the class was already manipulated, false otherwisepublic org.apache.felix.ipojo.metadata.Element getManipulationMetadata()
public static String extractInnerClassName(String clazz)
clazz - the qualified class namepublic List<MethodDescriptor> getMethods()
public Collection<String> getInnerClasses()
public int getClassVersion()
public void addMethodToInnerClass(String name, MethodDescriptor md)
name - the inner class namemd - the method descriptor to addpublic void prepareInnerClass(String inner, byte[] bytecode) throws IOException
inner - the inner class namebytecode - the bytecode of the inner classIOExceptionpublic byte[] manipulateInnerClass(String inner, byte[] bytecode) throws IOException
inner - the inner class namebytecode - input (i.e. original) classIOException - the class cannot be read correctlypublic List<MethodDescriptor> getMethodsFromInnerClass(String innerClassInternalName)
public Map<String,List<MethodDescriptor>> getInnerClassesAndMethods()
Copyright © 2006–2023 The Apache Software Foundation. All rights reserved.