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