public class ReplaceMethodPrimitive extends MethodPrimitive
Modifier and Type | Field and Description |
---|---|
protected com.github.javaparser.ast.body.MethodDeclaration |
declaration |
protected com.github.javaparser.ast.body.MethodDeclaration |
invoker |
static int |
MODIFIERS |
exceptionClasses, modifiers, parameterClasses, returnClass
changesClassHierarchy, classContent, clazz, modifiedClasses
Constructor and Description |
---|
ReplaceMethodPrimitive(ClassContent classContent,
java.lang.String name,
java.lang.String body,
java.lang.Class<?> returnType,
java.lang.Class<?>[] parameterClasses,
java.lang.Class<?> newReturnType,
java.lang.Class<?>[] newParameterClasses) |
Modifier and Type | Method and Description |
---|---|
protected void |
executePrimitive()
Adds the replace method and redirects the old method to the new one
|
protected void |
undoPrimitive()
Reverts the changes
|
getBodyInvoker, getDescriptor, getInvokerDescriptor, setThrows
changeVersion, execute, getSuperClass, getTargetClass, isSafe, undo, undoUpdateVersion, updateVersion, updateVersion
public static final int MODIFIERS
protected com.github.javaparser.ast.body.MethodDeclaration declaration
protected com.github.javaparser.ast.body.MethodDeclaration invoker
public ReplaceMethodPrimitive(ClassContent classContent, java.lang.String name, java.lang.String body, java.lang.Class<?> returnType, java.lang.Class<?>[] parameterClasses, java.lang.Class<?> newReturnType, java.lang.Class<?>[] newParameterClasses)
protected void executePrimitive() throws StructuralIntercessionException
executePrimitive
in class AbstractPrimitive
StructuralIntercessionException
- If there are any errorprotected void undoPrimitive() throws StructuralIntercessionException
undoPrimitive
in class AbstractPrimitive
StructuralIntercessionException
- If there are any error