public class SetSuperClassPrimitive extends AbstractPrimitive
changesClassHierarchy, classContent, clazz, modifiedClasses
Constructor and Description |
---|
SetSuperClassPrimitive(ClassContent classContent,
java.lang.Class<?> newSuperClass,
java.lang.Class<?>... typeParameters) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
changeVersion(java.lang.String content,
java.lang.Class<?> clazz,
int from,
int to)
Changes the version of the class in the source code.
|
protected void |
executePrimitive()
Adds the method and the invoker to the source code of the class
|
protected void |
undoPrimitive()
Reverts the changes
|
java.lang.String |
updateVersionRetStr(java.lang.Class<?> clazz,
java.lang.String superclassName) |
execute, getSuperClass, getTargetClass, isSafe, undo, undoUpdateVersion, updateVersion, updateVersion
public SetSuperClassPrimitive(ClassContent classContent, java.lang.Class<?> newSuperClass, java.lang.Class<?>... typeParameters)
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 errorpublic java.lang.String changeVersion(java.lang.String content, java.lang.Class<?> clazz, int from, int to)
AbstractPrimitive
changeVersion
in class AbstractPrimitive
content
- The source codeclazz
- The original classfrom
- Actual version number of the source codeto
- New version numberpublic java.lang.String updateVersionRetStr(java.lang.Class<?> clazz, java.lang.String superclassName) throws StructuralIntercessionException
StructuralIntercessionException