public class DeleteFieldPrimitive extends FieldPrimitive
declaration, getter, name, setter, unary
changesClassHierarchy, classContent, clazz, modifiedClasses
Constructor and Description |
---|
DeleteFieldPrimitive(ClassContent classContent,
java.lang.String name,
java.lang.Class<?> type) |
Modifier and Type | Method and Description |
---|---|
protected void |
addSupportMethods(com.github.javaparser.ast.body.TypeDeclaration type)
Add deleted auxiliary methods
|
protected void |
executePrimitive()
Removes the declaration of one field from the source code of the class
|
protected java.lang.String |
getGetterDescriptor() |
protected java.lang.String |
getSetterDescriptor() |
protected java.lang.String |
getUnaryDescriptor() |
boolean |
isSafe()
Returns if the primitive is safe or not.
|
protected void |
removeSupportMethods(com.github.javaparser.ast.CompilationUnit unit,
com.github.javaparser.ast.body.TypeDeclaration type)
Delete the auxiliary method of the deleted field
|
protected void |
undoPrimitive()
Revert the changes done
|
getAuxiliaryMethodVisibility
changeVersion, execute, getSuperClass, getTargetClass, undo, undoUpdateVersion, updateVersion, updateVersion
public DeleteFieldPrimitive(ClassContent classContent, java.lang.String name, java.lang.Class<?> type)
protected void executePrimitive() throws StructuralIntercessionException
executePrimitive
in class AbstractPrimitive
StructuralIntercessionException
- If there are any errorprotected void removeSupportMethods(com.github.javaparser.ast.CompilationUnit unit, com.github.javaparser.ast.body.TypeDeclaration type)
unit
- CompilationUnit
of the classtype
- TypeDeclaration
of the classprotected void undoPrimitive() throws StructuralIntercessionException
undoPrimitive
in class AbstractPrimitive
StructuralIntercessionException
- If there are any errorprotected void addSupportMethods(com.github.javaparser.ast.body.TypeDeclaration type)
type
- TypeDeclaration
of the classpublic boolean isSafe()
AbstractPrimitive
isSafe
in interface Primitive
isSafe
in class AbstractPrimitive
protected java.lang.String getGetterDescriptor()
protected java.lang.String getSetterDescriptor()
protected java.lang.String getUnaryDescriptor()