Package | Description |
---|---|
jmplib | |
jmplib.agent | |
jmplib.javaparser.util | |
jmplib.primitives | |
jmplib.primitives.impl | |
jmplib.reflect | |
jmplib.sourcecode | |
jmplib.util | |
jmplib.util.intercessor |
Modifier and Type | Method and Description |
---|---|
void |
TransactionalIntercessor.addAnnotation(Method method,
java.lang.reflect.Type... annotationObjects) |
void |
SimpleIntercessor.addAnnotation(Method met,
java.lang.reflect.Type... annotations) |
default void |
IIntercessor.addAnnotation(java.lang.reflect.Method met,
java.lang.reflect.Type... annotations)
Add the provided annotations to the specified method.
|
void |
IIntercessor.addAnnotation(Method met,
java.lang.reflect.Type... annotations) |
void |
TransactionalIntercessor.addAnnotation(java.lang.reflect.Type clazz,
java.lang.reflect.Type... annotationObjects)
Add the provided annotations to the specified class.
|
void |
SimpleIntercessor.addAnnotation(java.lang.reflect.Type clazz,
java.lang.reflect.Type... annotations)
Add the provided annotations to the specified class.
|
void |
IIntercessor.addAnnotation(java.lang.reflect.Type clazz,
java.lang.reflect.Type... annotations)
Add the provided annotations to the specified class.
|
void |
TransactionalIntercessor.addField(java.lang.reflect.Type clazz,
Field... fields) |
void |
SimpleIntercessor.addField(java.lang.reflect.Type clazz,
Field... fields) |
default void |
IIntercessor.addField(java.lang.reflect.Type clazz,
java.lang.reflect.Field... fields)
Adds fields to the specified class
For example:
Intercessor.addField(Person.class, new jmplib.reflect.Field(String.class, "lastName"));
|
void |
IIntercessor.addField(java.lang.reflect.Type clazz,
Field... fields) |
void |
TransactionalIntercessor.addGenericType(Method method,
TypeVariable<?>... types) |
void |
SimpleIntercessor.addGenericType(Method met,
TypeVariable<?>... types) |
default void |
IIntercessor.addGenericType(java.lang.reflect.Method met,
TypeVariable<?>... types)
Add the provided generic types to the specified method.
|
void |
IIntercessor.addGenericType(Method met,
TypeVariable<?>... types) |
void |
TransactionalIntercessor.addGenericType(java.lang.reflect.Type clazz,
TypeVariable<?>... types)
Add the provided generic type to the specified class.
|
void |
SimpleIntercessor.addGenericType(java.lang.reflect.Type clazz,
TypeVariable<?>... types)
Add the provided generic type to the specified class.
|
void |
IIntercessor.addGenericType(java.lang.reflect.Type clazz,
TypeVariable<?>... types)
Add the provided generic type to the specified class.
|
void |
TransactionalIntercessor.addImport(java.lang.reflect.Type clazz,
Class<?>... importObjects) |
void |
SimpleIntercessor.addImport(java.lang.reflect.Type clazz,
Class<?>... importObjects) |
default void |
IIntercessor.addImport(java.lang.reflect.Type clazz,
java.lang.Class<?>... imports)
Add the provided imports to the source file that defines the specified class.
|
void |
IIntercessor.addImport(java.lang.reflect.Type clazz,
Class<?>... imports) |
void |
TransactionalIntercessor.addImport(java.lang.reflect.Type clazz,
java.lang.Package... importObjects)
Add the provided imports to the source file that defines the specified class.
|
void |
SimpleIntercessor.addImport(java.lang.reflect.Type clazz,
java.lang.Package... importObjects)
Add the provided imports to the source file that defines the specified class.
|
void |
IIntercessor.addImport(java.lang.reflect.Type clazz,
java.lang.Package... imports)
Add the provided imports to the source file that defines the specified class.
|
void |
TransactionalIntercessor.addInterface(java.lang.reflect.Type clazz,
java.util.Map<java.lang.reflect.Type,java.lang.reflect.Type[]> interfs)
Version of the previous method able to add multiple interfaces.
|
void |
SimpleIntercessor.addInterface(java.lang.reflect.Type clazz,
java.util.Map<java.lang.reflect.Type,java.lang.reflect.Type[]> interfs)
Version of the previous method able to add multiple interfaces.
|
void |
IIntercessor.addInterface(java.lang.reflect.Type clazz,
java.util.Map<java.lang.reflect.Type,java.lang.reflect.Type[]> interfs)
Version of the previous method able to add multiple interfaces.
|
void |
TransactionalIntercessor.addInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf,
java.lang.reflect.Type... typeParameters)
Adds an interface to the provided class.
|
void |
SimpleIntercessor.addInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf,
java.lang.reflect.Type... typeParameters)
Adds an interface to the provided class.
|
void |
IIntercessor.addInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf,
java.lang.reflect.Type... typeParameters)
Adds an interface to the provided class.
|
void |
TransactionalIntercessor.addMethod(java.lang.reflect.Type clazz,
Method... methods) |
void |
SimpleIntercessor.addMethod(java.lang.reflect.Type clazz,
Method... methods) |
default void |
IIntercessor.addMethod(java.lang.reflect.Type clazz,
java.lang.reflect.Method... methods)
Adds methods to the specified class
For example:
// Declaring MethodType
MethodType mt = MethodType.methodType(int.class, int.class);
// Adding method to Counter
Intercessor.addMethod(Counter.class, new jmplib.reflect.Method("sum", mt,
"return this.counter += value;", "value"));
|
void |
IIntercessor.addMethod(java.lang.reflect.Type clazz,
Method... methods) |
void |
TransactionalIntercessor.addPublicInterfaceOf(java.lang.reflect.Type origin,
java.lang.reflect.Type destination)
Adds all the members of the public interface of the specified class to
another class
|
void |
SimpleIntercessor.addPublicInterfaceOf(java.lang.reflect.Type origin,
java.lang.reflect.Type destination)
Adds all the members of the public interface of the specified class to
another class
|
void |
IIntercessor.addPublicInterfaceOf(java.lang.reflect.Type origin,
java.lang.reflect.Type destination)
Adds all the members of the public interface of the specified class to
another class
|
void |
TransactionalIntercessor.commit()
Performs the operations indicated to the intercessor, if the intercessor has
the ability to store the operations until they are executed at the same time.
|
default void |
IIntercessor.commit()
Performs the operations indicated to the intercessor, if the intercessor has
the ability to store the operations until they are executed at the same time.
|
Class<?> |
TransactionalIntercessor.createClassClone(java.lang.String packageName,
java.lang.String className,
java.lang.reflect.Type origin)
Creates a class clone of the specified class with the specified name and
belonging to the provided package
|
Class<?> |
SimpleIntercessor.createClassClone(java.lang.String packageName,
java.lang.String className,
java.lang.reflect.Type origin)
Creates a class clone of the specified class with the specified name and
belonging to the provided package
|
Class<?> |
IIntercessor.createClassClone(java.lang.String packageName,
java.lang.String className,
java.lang.reflect.Type origin)
Creates a class clone of the specified class with the specified name and
belonging to the provided package
|
java.lang.Class<?> |
SimpleEvaluator.createEmptyClass(java.lang.String packageName,
java.lang.String className,
java.lang.reflect.AnnotatedElement... importClasses)
This method is a front-end of the exec method specially created to easily
return empty classes with a concrete name and package.
|
java.lang.Class<?> |
IEvaluator.createEmptyClass(java.lang.String packageName,
java.lang.String className,
java.lang.reflect.AnnotatedElement... imports)
This method is a front-end of the exec method specially created to easily
return empty classes with a concrete name and package.
|
java.lang.Class<?> |
SimpleEvaluator.exec(java.lang.String classSource)
Exec method allows the addition of new classes at runtime from its source
code to the application.
|
java.lang.Class<?> |
IEvaluator.exec(java.lang.String classSource)
Exec method allows the addition of new classes at runtime from its source
code to the application.
|
<T> T |
SimpleEvaluator.generateEvalInvoker(java.lang.String code,
EvalInvokerData<T> invokerData)
This method generates classes that implements generic functional interfaces,
that have to extend
EnvironmentSetUp interface. |
<T> T |
IEvaluator.generateEvalInvoker(java.lang.String code,
EvalInvokerData<T> invokerData)
This method generates classes that implements generic functional interfaces,
that have to extend
EnvironmentSetUp interface. |
<T> T |
ThreadSafeSimpleEvaluator.getFieldInvoker(java.lang.reflect.Type type,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to provide one field getter.
|
<T> T |
SimpleEvaluator.getFieldInvoker(java.lang.reflect.Type type,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to provide one field getter.
|
<T> T |
IEvaluator.getFieldInvoker(java.lang.reflect.Type clazz,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to provide one field getter.
|
java.lang.reflect.AnnotatedElement[] |
TransactionalIntercessor.getImports(java.lang.reflect.Type clazz)
Get the imports of the source file that defines the specified class.
|
java.lang.reflect.AnnotatedElement[] |
SimpleIntercessor.getImports(java.lang.reflect.Type clazz)
Get the imports of the source file that defines the specified class.
|
java.lang.reflect.AnnotatedElement[] |
IIntercessor.getImports(java.lang.reflect.Type clazz)
Get the imports of the source file that defines the specified class.
|
<T> T |
ThreadSafeSimpleEvaluator.getMethodInvoker(java.lang.reflect.Type type,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to invoke one method.
|
<T> T |
SimpleEvaluator.getMethodInvoker(java.lang.reflect.Type type,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to invoke one method.
|
<T> T |
IEvaluator.getMethodInvoker(java.lang.reflect.Type clazz,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to invoke one method.
|
void |
TransactionalIntercessor.implementInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf,
Method[] methods,
java.lang.Class<?>... typeParameters) |
void |
SimpleIntercessor.implementInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf,
Method[] methods,
java.lang.Class<?>... typeParameters) |
default void |
IIntercessor.implementInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf,
java.lang.reflect.Method[] methods,
java.lang.Class<?>... typeParameters)
Version of the addInterface method that also allow to add a series of method
that belong to the interface to be implemented.
|
void |
IIntercessor.implementInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf,
Method[] methods,
java.lang.Class<?>... typeParameters) |
void |
TransactionalIntercessor.removeField(java.lang.reflect.Type clazz,
Field... fields) |
void |
SimpleIntercessor.removeField(java.lang.reflect.Type clazz,
Field... fields) |
default void |
IIntercessor.removeField(java.lang.reflect.Type clazz,
java.lang.reflect.Field... fields)
Removes fields in the specified class
For example:
Intercessor.deleteField(Person.class, new jmplib.reflect.Field("lastName"));
|
void |
IIntercessor.removeField(java.lang.reflect.Type clazz,
Field... fields) |
void |
TransactionalIntercessor.removeInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf)
Removes an interface from a class
|
void |
SimpleIntercessor.removeInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf)
Removes an interface from a class
|
void |
IIntercessor.removeInterface(java.lang.reflect.Type clazz,
java.lang.reflect.Type interf)
Removes an interface from a class
|
void |
TransactionalIntercessor.removeMethod(java.lang.reflect.Type clazz,
Method... methods) |
void |
SimpleIntercessor.removeMethod(java.lang.reflect.Type clazz,
Method... methods) |
default void |
IIntercessor.removeMethod(java.lang.reflect.Type clazz,
java.lang.reflect.Method... methods)
Removes a series of methods from the specified class
For example:
// Deleting method
Intercessor.deleteMethod(Dog.class, new jmplib.reflect.Method("bark"));
Dog dog = new Dog();
dog.bark(); // Throws RuntimeException
|
void |
IIntercessor.removeMethod(java.lang.reflect.Type clazz,
Method... methods) |
void |
TransactionalIntercessor.removeSuperclass(java.lang.reflect.Type clazz)
Removes the superclass of an existing class, setting it to Object.
|
void |
SimpleIntercessor.removeSuperclass(java.lang.reflect.Type clazz)
Removes the superclass of an existing class, setting it to Object.
|
void |
IIntercessor.removeSuperclass(java.lang.reflect.Type clazz)
Removes the superclass of an existing class, setting it to Object.
|
void |
TransactionalIntercessor.replaceField(java.lang.reflect.Type clazz,
Field... fields) |
void |
SimpleIntercessor.replaceField(java.lang.reflect.Type clazz,
Field... fields) |
default void |
IIntercessor.replaceField(java.lang.reflect.Type clazz,
java.lang.reflect.Field... fields)
Replaces fields in the specified class
For example:
Intercessor.replaceField(Calculator.class, new jmplib.reflect.Field("lastResult", double.class));
|
void |
IIntercessor.replaceField(java.lang.reflect.Type clazz,
Field... fields) |
void |
TransactionalIntercessor.replaceImplementation(java.lang.reflect.Type clazz,
Method... methods) |
void |
SimpleIntercessor.replaceImplementation(java.lang.reflect.Type clazz,
Method... methods) |
default void |
IIntercessor.replaceImplementation(java.lang.reflect.Type clazz,
java.lang.reflect.Method... methods)
Replace the implementation of a series of methods of the specified class
For example, modifying the method to use a new field called lastResult:
// Modify a the method code
Intercessor.replaceImplementation(Calculator.class, new jmplib.reflect.Method("sum",
"this.lastResult = a + b;"
+ "return this.lastResult;"));
|
void |
IIntercessor.replaceImplementation(java.lang.reflect.Type clazz,
Method... methods) |
void |
TransactionalIntercessor.replaceMethod(java.lang.reflect.Type clazz,
java.util.Map<Method,Method> methods)
Replaces a series of methods from the specified class
For example, modifying the method to acept a more generic type (Dog ->
Animal):
// Creating MethodType
MethodType newType = MethodType.methodType(void.class, Pet.class);
// Modifying the method
Intercessor.replaceMethod(Owner.class, new jmplib.reflect.Method("addPet", newType,
"this.pet = dog;"));
|
void |
SimpleIntercessor.replaceMethod(java.lang.reflect.Type clazz,
java.util.Map<Method,Method> methods)
Replaces a series of methods from the specified class
For example, modifying the method to acept a more generic type (Dog ->
Animal):
// Creating MethodType
MethodType newType = MethodType.methodType(void.class, Pet.class);
// Modifying the method
Intercessor.replaceMethod(Owner.class, new jmplib.reflect.Method("addPet", newType,
"this.pet = dog;"));
|
void |
IIntercessor.replaceMethod(java.lang.reflect.Type clazz,
java.util.Map<Method,Method> methods)
Replaces a series of methods from the specified class
For example, modifying the method to acept a more generic type (Dog ->
Animal):
// Creating MethodType
MethodType newType = MethodType.methodType(void.class, Pet.class);
// Modifying the method
Intercessor.replaceMethod(Owner.class, new jmplib.reflect.Method("addPet", newType,
"this.pet = dog;"));
|
void |
TransactionalIntercessor.replaceMethod(java.lang.reflect.Type clazz,
Method method,
Method newMethod) |
void |
SimpleIntercessor.replaceMethod(java.lang.reflect.Type clazz,
Method method,
Method newMethod) |
default void |
IIntercessor.replaceMethod(java.lang.reflect.Type clazz,
java.lang.reflect.Method method,
java.lang.reflect.Method newMethod)
Replaces a method of the specified class
|
void |
IIntercessor.replaceMethod(java.lang.reflect.Type clazz,
Method method,
Method newMethod) |
void |
TransactionalIntercessor.setAnnotation(Method method,
java.lang.reflect.Type... annotationObjects) |
void |
SimpleIntercessor.setAnnotation(Method met,
java.lang.reflect.Type... annotations) |
default void |
IIntercessor.setAnnotation(java.lang.reflect.Method met,
java.lang.reflect.Type... annotations)
Replace the annotations of a method with the provided ones.
|
void |
IIntercessor.setAnnotation(Method met,
java.lang.reflect.Type... annotations) |
void |
TransactionalIntercessor.setAnnotation(java.lang.reflect.Type clazz,
java.lang.reflect.Type... annotationObjects)
Replace the annotations of the specified class with the provided ones.
|
void |
SimpleIntercessor.setAnnotation(java.lang.reflect.Type clazz,
java.lang.reflect.Type... annotations)
Replace the annotations of the specified class with the provided ones.
|
void |
IIntercessor.setAnnotation(java.lang.reflect.Type clazz,
java.lang.reflect.Type... annotations)
Replace the annotations of the specified class with the provided ones.
|
<T> T |
ThreadSafeSimpleEvaluator.setFieldInvoker(java.lang.reflect.Type type,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to provide one field setter.
|
<T> T |
SimpleEvaluator.setFieldInvoker(java.lang.reflect.Type type,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to provide one field setter.
|
<T> T |
IEvaluator.setFieldInvoker(java.lang.reflect.Type clazz,
java.lang.String name,
MemberInvokerData<T> info)
Generates an instance of the specified interface to provide one field setter.
|
void |
TransactionalIntercessor.setGenericType(Method method,
TypeVariable<?>... types) |
void |
SimpleIntercessor.setGenericType(Method met,
TypeVariable<?>... types) |
default void |
IIntercessor.setGenericType(java.lang.reflect.Method met,
TypeVariable<?>... types)
Replace the generic types of a method with the provided ones.
|
void |
IIntercessor.setGenericType(Method met,
TypeVariable<?>... types) |
void |
TransactionalIntercessor.setGenericType(java.lang.reflect.Type clazz,
TypeVariable<?>... types)
Replace the generic types of the specified class with the provided ones.
|
void |
SimpleIntercessor.setGenericType(java.lang.reflect.Type clazz,
TypeVariable<?>... types)
Replace the generic types of the specified class with the provided ones.
|
void |
IIntercessor.setGenericType(java.lang.reflect.Type clazz,
TypeVariable<?>... types)
Replace the generic types of the specified class with the provided ones.
|
void |
TransactionalIntercessor.setImports(java.lang.reflect.Type clazz,
java.lang.reflect.AnnotatedElement... importObjects)
Replace the imports of the source file that defines the specified class with
the provided ones.
|
void |
SimpleIntercessor.setImports(java.lang.reflect.Type clazz,
java.lang.reflect.AnnotatedElement... imports)
Replace the imports of the source file that defines the specified class with
the provided ones.
|
void |
IIntercessor.setImports(java.lang.reflect.Type clazz,
java.lang.reflect.AnnotatedElement... imports)
Replace the imports of the source file that defines the specified class with
the provided ones.
|
void |
TransactionalIntercessor.setSuperclass(java.lang.reflect.Type clazz,
java.lang.reflect.Type superclazz,
java.lang.reflect.Type... typeParameters)
Changes the superclass of an existing class, modifying member visibilities
accordingly.
|
void |
SimpleIntercessor.setSuperclass(java.lang.reflect.Type clazz,
java.lang.reflect.Type superclazz,
java.lang.reflect.Type... typeParameters)
Changes the superclass of an existing class, modifying member visibilities
accordingly.
|
void |
IIntercessor.setSuperclass(java.lang.reflect.Type clazz,
java.lang.reflect.Type superclazz,
java.lang.reflect.Type... typeParameters)
Changes the superclass of an existing class, modifying member visibilities
accordingly.
|
Modifier and Type | Method and Description |
---|---|
static void |
UpdaterAgent.run(java.lang.String sourceMethodName,
java.lang.String agentArgs,
java.lang.instrument.Instrumentation inst)
The function of this method is initialize the transformers that will process
the classes to update them.
|
Modifier and Type | Method and Description |
---|---|
static com.github.javaparser.ast.CompilationUnit |
JavaParserUtils.getCompilationUnit(java.lang.Class<?> classObject)
Obtains a JavaParser compilation unit from a class object.
|
Modifier and Type | Method and Description |
---|---|
static Primitive |
PrimitiveFactory.createAddAnnotationToClassPrimitive(java.lang.Class<?> clazz,
java.lang.Class<?>[] annotations)
Creates
createAddAnnotationToClassPrimitive |
static Primitive |
PrimitiveFactory.createAddAnnotationToMethodPrimitive(java.lang.reflect.Method met,
java.lang.Class<?>[] annotations)
Creates
createAddAnnotationToMethodPrimitive |
static Primitive |
PrimitiveFactory.createAddFieldPrimitive(java.lang.Class<?> clazz,
int modifiers,
java.lang.Class<?> type,
java.lang.String name,
java.lang.String init)
Creates
AddFieldPrimitive |
static Primitive |
PrimitiveFactory.createAddGenericTypeToClassPrimitive(java.lang.Class<?> clazz,
TypeVariable<?>[] tvs)
Creates
createAddGenericTypeToClassPrimitive |
static Primitive |
PrimitiveFactory.createAddGenericTypeToMethodPrimitive(java.lang.reflect.Method met,
TypeVariable<?>[] tvs)
Creates
createAddGenericTypeToMethodPrimitive |
static Primitive |
PrimitiveFactory.createAddImportPrimitive(java.lang.Class<?> clazz,
java.lang.String[] imports)
Creates
AddImportPrimitive |
static Primitive |
PrimitiveFactory.createAddInterfacePrimitive(java.lang.Class<?> clazz,
java.lang.Class<?> interf,
java.lang.Class<?>... typeParameters)
Creates
AddInterfacePrimitive |
static Primitive |
PrimitiveFactory.createAddMethodPrimitive(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.invoke.MethodType type,
java.lang.String[] paramNames,
java.lang.String body,
int modifiers,
java.lang.Class<?>... exceptions)
Creates
AddMethodPrimitive |
static Primitive |
PrimitiveFactory.createAddMethodPrimitive(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.invoke.MethodType type,
java.lang.String[] paramNames,
java.lang.String body,
int modifiers,
java.lang.reflect.Type[] genericParamTypes,
java.lang.reflect.Type genericReturnType,
TypeVariable<?>[] methodTypeParameters,
java.lang.Class<?>... exceptions)
Creates
AddMethodPrimitive |
static Primitive |
PrimitiveFactory.createDeleteFieldPrimitive(java.lang.Class<?> clazz,
java.lang.String name)
Creates
DeleteFieldPrimitive |
static Primitive |
PrimitiveFactory.createDeleteMethodPrimitive(java.lang.Class<?> clazz,
java.lang.String name)
Creates
DeleteMethodPrimitive |
static Primitive |
PrimitiveFactory.createDeleteMethodPrimitive(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.invoke.MethodType type)
Creates
DeleteMethodPrimitive |
static Primitive |
PrimitiveFactory.createGetImportPrimitive(java.lang.Class<?> clazz)
Creates
GetImportPrimitive |
static Primitive |
PrimitiveFactory.createRemoveInterfacePrimitive(java.lang.Class<?> clazz,
java.lang.Class<?> interf)
Creates
RemoveInterfacePrimitive |
static Primitive |
PrimitiveFactory.createRemoveSuperClassPrimitive(java.lang.Class<?> clazz)
Creates
RemoveSuperClassPrimitive |
static Primitive |
PrimitiveFactory.createReplaceFieldPrimitive(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.Class<?> newType,
java.lang.String newInit)
Creates
ReplaceFieldPrimitive |
static Primitive |
PrimitiveFactory.createReplaceImplementationPrimitive(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.invoke.MethodType type,
java.lang.String body)
Creates
ReplaceImplementationPrimitive |
static Primitive |
PrimitiveFactory.createReplaceImplementationPrimitive(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.String body)
Creates
ReplaceImplementationPrimitive |
static Primitive |
PrimitiveFactory.createReplaceMethodPrimitive(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.invoke.MethodType newMethodType,
java.lang.String body)
Creates
ReplaceMethodPrimitive |
static Primitive |
PrimitiveFactory.createReplaceMethodPrimitive(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.invoke.MethodType newMethodType,
java.lang.String body)
Creates
ReplaceMethodPrimitive |
static Primitive |
PrimitiveFactory.createSetAnnotationToClassPrimitive(java.lang.Class<?> clazz,
java.lang.Class<?>[] annotations)
Creates
createSetAnnotationToClassPrimitive |
static Primitive |
PrimitiveFactory.createSetAnnotationToMethodPrimitive(java.lang.reflect.Method met,
java.lang.Class<?>[] annotations)
Creates
createSetAnnotationToMethodPrimitive |
static Primitive |
PrimitiveFactory.createSetGenericTypeToClassPrimitive(java.lang.Class<?> clazz,
TypeVariable<?>[] tvs)
Creates
createSetGenericTypeToClassPrimitive |
static Primitive |
PrimitiveFactory.createSetGenericTypeToMethodPrimitive(java.lang.reflect.Method met,
TypeVariable<?>[] tvs)
Creates
createSetGenericTypeToMethodPrimitive |
static Primitive |
PrimitiveFactory.createSetImportPrimitive(java.lang.Class<?> clazz,
java.lang.String[] imports)
Creates
SetImportPrimitive |
static Primitive |
PrimitiveFactory.createSetSuperClassPrimitive(java.lang.Class<?> clazz,
java.lang.Class<?> superclazz,
java.lang.Class<?>... typeParameters)
Creates
SetSuperClassPrimitive |
java.util.Set<ClassContent> |
Primitive.execute()
Apply the primitive over the
ClassContent |
java.util.Set<ClassContent> |
AbstractPrimitive.execute()
Do changes in the class and update the version number
|
protected abstract void |
AbstractPrimitive.executePrimitive()
Method that each primitive have to override to implement its own
funtionality.
|
void |
PrimitiveExecutor.executePrimitives()
Executes all primitives in order.
|
protected java.lang.Class<?> |
AbstractPrimitive.getSuperClass(ClassContent classContent) |
void |
Primitive.undo()
Revert all the changes.
|
void |
AbstractPrimitive.undo()
Reverts all changes
|
protected abstract void |
AbstractPrimitive.undoPrimitive()
Method that each primitive have to override to revert its own changes
over the ClassContent.
|
protected void |
AbstractPrimitive.updateVersion(java.lang.Class<?> clazz,
java.lang.String superclassName)
Updates the class and subclasses provided
|
Modifier and Type | Method and Description |
---|---|
protected void |
SetSuperClassPrimitive.executePrimitive()
Adds the method and the invoker to the source code of the class
|
protected void |
SetImportPrimitive.executePrimitive()
Adds the specified import to the source code file of the class
|
protected void |
SetGenericTypeToMethodPrimitive.executePrimitive()
Set the specified annotations to the class
|
protected void |
SetGenericTypeToClassPrimitive.executePrimitive()
Set the specified annotations to the class
|
protected void |
SetAnnotationToMethodPrimitive.executePrimitive()
Set the specified annotations to the class
|
protected void |
SetAnnotationToClassPrimitive.executePrimitive()
Set the specified annotations to the class
|
protected void |
ReplaceMethodPrimitive.executePrimitive()
Adds the replace method and redirects the old method to the new one
|
protected void |
ReplaceImplementationPrimitive.executePrimitive()
Changes the method body
|
protected void |
ReplaceFieldPrimitive.executePrimitive()
Changes the type of the field and the type of the auxiliary methods
|
protected void |
RemoveSuperClassPrimitive.executePrimitive()
Adds the method and the invoker to the source code of the class
|
protected void |
RemoveInterfacePrimitive.executePrimitive()
Adds the interface to the source code of the class
|
protected void |
GetImportPrimitive.executePrimitive()
Adds the specified import to the source code file of the class
|
protected void |
DeleteMethodPrimitive.executePrimitive()
Deletes one method and its invoker from the source code of the class
|
protected void |
DeleteFieldPrimitive.executePrimitive()
Removes the declaration of one field from the source code of the class
|
protected void |
AddMethodPrimitive.executePrimitive()
Adds the method and the invoker to the source code of the class
|
protected void |
AddInterfacePrimitive.executePrimitive()
Adds the interface to the source code of the class
|
protected void |
AddImportPrimitive.executePrimitive()
Adds the specified import to the source code file of the class
|
protected void |
AddGenericTypeToMethodPrimitive.executePrimitive()
Adds the specified annotations to the class
|
protected void |
AddGenericTypeToClassPrimitive.executePrimitive()
Adds the specified annotations to the class
|
protected void |
AddFieldPrimitive.executePrimitive()
Adds the field to the source code and the auxiliar methods needed
|
protected void |
AddAnnotationToMethodPrimitive.executePrimitive()
Adds the specified annotations to the class
|
protected void |
AddAnnotationToClassPrimitive.executePrimitive()
Adds the specified annotations to the class
|
protected void |
AddMethodPrimitive.generateMethod(java.lang.String name,
java.lang.String[] paramNames,
java.lang.String body)
Generates the method declaration
|
protected void |
AddMethodPrimitive.initializeFields(java.lang.String name,
java.lang.String[] paramNames,
java.lang.String body)
Generates the members needed in the primitive execution
|
protected void |
SetSuperClassPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
SetImportPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
SetGenericTypeToMethodPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
SetGenericTypeToClassPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
SetAnnotationToMethodPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
SetAnnotationToClassPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
ReplaceMethodPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
ReplaceImplementationPrimitive.undoPrimitive()
Restores the old body
|
protected void |
ReplaceFieldPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
RemoveSuperClassPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
RemoveInterfacePrimitive.undoPrimitive()
Reverts the changes
|
protected void |
GetImportPrimitive.undoPrimitive() |
protected void |
DeleteMethodPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
DeleteFieldPrimitive.undoPrimitive()
Revert the changes done
|
protected void |
AddMethodPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
AddInterfacePrimitive.undoPrimitive()
Reverts the changes
|
protected void |
AddImportPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
AddGenericTypeToMethodPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
AddGenericTypeToClassPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
AddFieldPrimitive.undoPrimitive()
Revert the changes
|
protected void |
AddAnnotationToMethodPrimitive.undoPrimitive()
Reverts the changes
|
protected void |
AddAnnotationToClassPrimitive.undoPrimitive()
Reverts the changes
|
java.lang.String |
SetSuperClassPrimitive.updateVersionRetStr(java.lang.Class<?> clazz,
java.lang.String superclassName) |
Modifier and Type | Method and Description |
---|---|
com.github.javaparser.ast.body.ClassOrInterfaceDeclaration |
Class.getClassDeclaration()
Gets the JavaParser ClassOrInterfaceDeclaration node from this class.
|
static java.lang.Class<?> |
DeclarationUtils.getDeclaringClass(com.github.javaparser.ast.body.FieldDeclaration m)
FIELDS
|
static java.lang.Class<?> |
DeclarationUtils.getDeclaringClass(com.github.javaparser.ast.body.MethodDeclaration m) |
static java.lang.Class<?> |
DeclarationUtils.getDecoratedClass(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration classNode)
CLASSES
|
static java.lang.reflect.Type[] |
DeclarationUtils.getExceptionTypes(com.github.javaparser.ast.body.MethodDeclaration md) |
com.github.javaparser.ast.body.FieldDeclaration |
Field.getFieldDeclaration()
Get the corresponding JavaParser FieldDeclaration node
|
static java.lang.Class<?> |
DeclarationUtils.getFieldType(com.github.javaparser.ast.body.FieldDeclaration m) |
com.github.javaparser.ast.body.MethodDeclaration |
Method.getMethodDeclaration()
EXTRA FUNCTIONALITY INCORPORATED BY JMPLIB
|
static java.lang.invoke.MethodType |
DeclarationUtils.getMethodType(com.github.javaparser.ast.body.MethodDeclaration md)
Utility method to get the method type.
|
java.lang.String |
Class.getSourceCode()
Outputs the Java source code of a class, if available.
|
Constructor and Description |
---|
Class(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration cl) |
Method(com.github.javaparser.ast.body.MethodDeclaration md) |
Method(java.lang.String name) |
Method(java.lang.String name,
java.lang.invoke.MethodType methodType) |
Method(java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body) |
Method(java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body,
int modifiers,
java.lang.String... parameterNames) |
Method(java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body,
java.lang.String... parameterNames) |
Method(java.lang.String name,
java.lang.String body) |
Method(java.lang.reflect.Type clazz,
java.lang.String name) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body,
int modifiers,
Class<?>[] exceptions,
java.lang.reflect.Type[] typeParameters,
java.lang.reflect.Type genericReturnType,
TypeVariable<?>[] methodTypeParameters,
java.lang.String... parameterNames) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body,
int modifiers,
java.lang.String... parameterNames) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body,
int modifiers,
java.lang.reflect.Type[] exceptions) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body,
int modifiers,
java.lang.reflect.Type[] exceptions,
java.lang.String... parameterNames) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body,
int modifiers,
java.lang.reflect.Type[] exceptions,
java.lang.reflect.Type[] typeParameters,
TypeVariable<?>[] methodTypeParameters,
java.lang.String... parameterNames) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.invoke.MethodType methodType,
java.lang.String body,
java.lang.String... parameterNames) |
Method(java.lang.reflect.Type clazz,
java.lang.String name,
java.lang.String body) |
Modifier and Type | Method and Description |
---|---|
ClassContent |
SourceCodeCache.getClassContent(java.lang.Class<?> clazz)
Obtains the
ClassContent of the specified class from the cache. |
Modifier and Type | Method and Description |
---|---|
static void |
FileUtils.copyDirectory(java.io.File source,
java.io.File destination)
Copy one directory into another
|
static java.io.File |
WrapperClassGenerator.createFile(java.lang.String name,
java.lang.String text)
Creates a java file inside the folder generated_src
|
static java.lang.reflect.Method |
MemberFinder.findMethod(java.lang.Class<?> declaring,
java.lang.String name)
Find if one method belongs a class
|
static <T> java.io.File |
WrapperClassGenerator.generateEvalClass(java.lang.String name,
java.lang.String code,
java.lang.Class<T> functionalInterface,
java.lang.String[] paramNames,
java.lang.Class<?>[] parametrizationClasses)
Generates a class to wrap the dynamic user code and compile it.
|
static <T> java.io.File |
WrapperClassGenerator.generateEvalClass(java.lang.String name,
java.lang.String code,
java.lang.Class<T> functionalInterface,
java.lang.String[] paramNames,
java.lang.Class<?>[] parametrizationClasses,
java.util.Map<java.lang.String,java.lang.Class<?>> environment)
Generates a class to wrap the dynamic user code and compile it.
|
static <T> java.io.File |
WrapperClassGenerator.generateEvalClass(java.lang.String name,
java.lang.String code,
java.lang.Class<T> functionalInterface,
java.lang.String[] paramNames,
java.lang.String[] imports,
java.lang.Class<?>[] parametrizationClasses)
Generates a class to wrap the dynamic user code and compile it.
|
static java.io.File |
WrapperClassGenerator.generateFieldGetter(java.lang.String className,
java.lang.Class<?> targetClass,
java.lang.String fieldName,
java.lang.Class<?> functionalInterface,
java.lang.Class<?>[] parametrizationClasses,
boolean isStatic)
Wraps fieldGetter invocation
|
static java.io.File |
WrapperClassGenerator.generateFieldSetter(java.lang.String className,
java.lang.Class<?> targetClass,
java.lang.String fieldName,
java.lang.Class<?> functionalInterface,
java.lang.Class<?>[] parametrizationClasses,
boolean isStatic)
Wraps fieldSetter invocation
|
static java.io.File |
WrapperClassGenerator.generateMethodInvoker(java.lang.String className,
java.lang.Class<?> targetClass,
java.lang.String methodName,
java.lang.Class<?> functionalInterface,
java.lang.Class<?>[] parametrizationClasses,
boolean isStatic)
Wraps method invocation
|
static java.lang.String |
FileUtils.getProperty(java.lang.String property,
java.lang.String fileName)
Obtains a property of on properties file
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
IntercessorUtils.compileFile(java.io.File file,
java.lang.String name,
java.lang.String packageName)
Compiles a class file and return an instance of the compiled class.
|