public class TestProcessor extends JavaSourceFileProcessor<TestProcessorContainer>
container, javaSource
Constructor and Description |
---|
TestProcessor(IJavaSourceParser<TestProcessorContainer> engine)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
TestProcessorContainer |
createPropertyContainer(ParsedJavaSource javaSource)
Creates the property container for the data required by the processor when no saved XML is present
at load-time.
|
void |
dispose()
Called when the Java source is disposed of.
|
static void |
initialize() |
boolean |
isRefactorRequired()
Checks if this parser needs to refactor something.
|
void |
onInitialize()
Called when the property container has been loaded from XML and should be initiated for specialized
data for the processor, e.g.
|
void |
onJavaSourceMoved(IFile oldFile,
IFile newFile,
String oldPKG,
String newPKG)
Called when a Java source has been moved or renamed.
|
void |
onJavaSourceRemoved(IFile file)
Called when a Java source has been removed.
|
void |
onRefactorCommit(MultiTextEdit fileChangeRootEdit)
Called when the refactoring on each source is to be performed.
|
void |
parse(CompilationUnit compilationUnit)
Called to parse the Java source at load and when the Java compiler runs,
using an AST compilation unit and a flag indicating if the compilation unit
contains annotations.
|
void |
reconcile(ReconcileContext context,
CompilationUnit cu)
Called by the Java compilation participant let the processor handle the reconciled working copy.
|
getAvailableMethods, getEngine, initialize, internalRestoreContainerClone, isReparseRequired, onRefactoringChange, onRestoreContainerClone, onRestoredState, validateClass, validateMethod
public TestProcessor(IJavaSourceParser<TestProcessorContainer> engine)
public static void initialize()
public TestProcessorContainer createPropertyContainer(ParsedJavaSource javaSource)
The processor should save the reference to JavaSource
in this call.
createPropertyContainer
in class JavaSourceFileProcessor<TestProcessorContainer>
javaSource
- The Java source.public void onInitialize()
The processor should save the reference to JavaSource
in this call.
onInitialize
in class JavaSourceFileProcessor<TestProcessorContainer>
public void dispose()
dispose
in class JavaSourceFileProcessor<TestProcessorContainer>
public void onJavaSourceMoved(IFile oldFile, IFile newFile, String oldPKG, String newPKG)
getSourceFile()
method in JavaSource is already moved or renamed when this method is called.
Subclasses can override this method to perform reference updates.
onJavaSourceMoved
in class JavaSourceFileProcessor<TestProcessorContainer>
oldFile
- The old file name.newFile
- The new file name.oldPKG
- The old package name of the main class.newPKG
- The new package name of the main class.public void onJavaSourceRemoved(IFile file)
Subclasses can override this method to perform reference updates.
onJavaSourceRemoved
in class JavaSourceFileProcessor<TestProcessorContainer>
file
- The file.public void parse(CompilationUnit compilationUnit) throws CoreException
parse
in class JavaSourceFileProcessor<TestProcessorContainer>
compilationUnit
- The compilation unit.CoreException
- For errors with e.g. removing markers.public void reconcile(ReconcileContext context, CompilationUnit cu)
reconcile
in class JavaSourceFileProcessor<TestProcessorContainer>
context
- The reconcile context to act on.public boolean isRefactorRequired()
isRefactorRequired
in class JavaSourceFileProcessor<TestProcessorContainer>
public void onRefactorCommit(MultiTextEdit fileChangeRootEdit)
When this method is called, refactoring the code for a plain text file using positions would look like:
ReplaceEdit edit=new ReplaceEdit(offset,length,string); fileChangeRootEdit.addChild(edit);
onRefactorCommit
in class JavaSourceFileProcessor<TestProcessorContainer>
fileChangeRootEdit
- The root edit of the Java file change.iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.