Package EDU.purdue.cs.bloat.editor
Interface EditorContext
-
- All Known Implementing Classes:
BloatContext,CachingBloatContext,PersistentBloatContext
public interface EditorContextAn EditorContext supplies a means of loading and editing classes. Note that a number of these methods are identical to methods in Editor. It is expected that an EditorContext will have a different caching (of ClassEditors, etc.) policy than Editor does. Hence, the methods in EditorContext should be used to edit classes, etc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcommit()Commits all changes made to classes, methods, and fields.voidcommit(ClassInfo info)Commits the changes made to a class.voidcommit(FieldInfo info)Commits the changes made to a field.voidcommit(MethodInfo info)Commits the changes made to a method.ClassEditoreditClass(Type classType)Returns a ClassEditor used to edit a class described by a given Type.ClassEditoreditClass(ClassInfo info)Returns a ClassEditor used to edit a class described by a given ClassInfo.ClassEditoreditClass(java.lang.String className)Returns a ClassEditor used to edit a class of a given name.FieldEditoreditField(MemberRef field)Returns a FieldEditor for editing a field.FieldEditoreditField(FieldInfo info)Returns a FieldEditor for editing a FieldInfo.MethodEditoreditMethod(MemberRef method)Returns a MethodEditor for editing a method.MethodEditoreditMethod(MethodInfo info)Returns a MethodEditor for editing a method.ClassHierarchygetHierarchy()Returns the ClassHierarchy of all classes and interfaces known to BLOAT.ClassInfoloadClass(java.lang.String className)Loads a class into BLOATClassEditornewClass(int modifiers, java.lang.String className, Type superType, Type[] interfaces)Returns aClassEditorfor editing a new class with the given name.ClassInfonewClassInfo(int modifiers, int classIndex, int superClassIndex, int[] interfaceIndexes, java.util.List constants)Creates a newClassInfovoidrelease(ClassInfo info)Signals that we are done editing a class.voidrelease(FieldInfo info)Signals that we are done editing a field.voidrelease(MethodInfo info)Signals that we are done editing a method.
-
-
-
Method Detail
-
loadClass
ClassInfo loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
Loads a class into BLOAT- Throws:
java.lang.ClassNotFoundException
-
newClassInfo
ClassInfo newClassInfo(int modifiers, int classIndex, int superClassIndex, int[] interfaceIndexes, java.util.List constants)
Creates a newClassInfo- Parameters:
modifiers- The modifiers describing the newly-created classclassIndex- The index of the name of the newly-created class in its constant poolsuperClassIndex- The index of the name of the newly-created class's superclass in its constant poolinterfaceIndexes- The indexes of the names of the interfaces that the newly-created class implementsconstants- The constant pool for the newly created class (a list ofConstants).
-
getHierarchy
ClassHierarchy getHierarchy()
Returns the ClassHierarchy of all classes and interfaces known to BLOAT.
-
newClass
ClassEditor newClass(int modifiers, java.lang.String className, Type superType, Type[] interfaces)
Returns aClassEditorfor editing a new class with the given name. It will override any class with the given name that is already being edited.
-
editClass
ClassEditor editClass(java.lang.String className) throws java.lang.ClassNotFoundException, ClassFormatException
Returns a ClassEditor used to edit a class of a given name.- Throws:
java.lang.ClassNotFoundExceptionClassFormatException
-
editClass
ClassEditor editClass(Type classType) throws java.lang.ClassNotFoundException, ClassFormatException
Returns a ClassEditor used to edit a class described by a given Type.- Throws:
java.lang.ClassNotFoundExceptionClassFormatException
-
editClass
ClassEditor editClass(ClassInfo info)
Returns a ClassEditor used to edit a class described by a given ClassInfo.
-
editField
FieldEditor editField(FieldInfo info)
Returns a FieldEditor for editing a FieldInfo.
-
editField
FieldEditor editField(MemberRef field) throws java.lang.NoSuchFieldException
Returns a FieldEditor for editing a field.- Throws:
java.lang.NoSuchFieldException
-
editMethod
MethodEditor editMethod(MethodInfo info)
Returns a MethodEditor for editing a method.
-
editMethod
MethodEditor editMethod(MemberRef method) throws java.lang.NoSuchMethodException
Returns a MethodEditor for editing a method.- Throws:
java.lang.NoSuchMethodException
-
release
void release(MethodInfo info)
Signals that we are done editing a method. The object used to model it may be reclaimed.
-
release
void release(FieldInfo info)
Signals that we are done editing a field. The object used to model it may be reclaimed.
-
release
void release(ClassInfo info)
Signals that we are done editing a class. The object used to model it may be reclaimed.
-
commit
void commit(ClassInfo info)
Commits the changes made to a class.
-
commit
void commit(MethodInfo info)
Commits the changes made to a method.
-
commit
void commit(FieldInfo info)
Commits the changes made to a field.
-
commit
void commit()
Commits all changes made to classes, methods, and fields.
-
-