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, returnClasschangesClassHierarchy, 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, setThrowschangeVersion, execute, getSuperClass, getTargetClass, isSafe, undo, undoUpdateVersion, updateVersion, updateVersionpublic 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 AbstractPrimitiveStructuralIntercessionException - If there are any errorprotected void undoPrimitive()
throws StructuralIntercessionException
undoPrimitive in class AbstractPrimitiveStructuralIntercessionException - If there are any error