public abstract class JavaFix extends Object
Fix by means of the toEditorFix() method.for various predefined fixes.| Modifier and Type | Class and Description |
|---|---|
static class |
JavaFix.TransformationContext
A context that contains a reference to a
WorkingCopy through which
modifications of Java source code can be made. |
| Modifier | Constructor and Description |
|---|---|
protected |
JavaFix(CompilationInfo info,
TreePath tp)
Create JavaFix with the given base
TreePath. |
protected |
JavaFix(TreePathHandle handle)
Create JavaFix with the given base
TreePathHandle. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract String |
getText()
The display text of the fix.
|
protected abstract void |
performRewrite(JavaFix.TransformationContext ctx)
Do the transformations needed to implement the hint's function.
|
Fix |
toEditorFix()
|
protected JavaFix(@NonNull CompilationInfo info, @NonNull TreePath tp)
TreePath. The base TreePath
will be passed back to the real implementation of the fix.info - a CompilationInfo from which the given TreePath originatestp - a TreePath that will be passed back to the
performRewrite(org.netbeans.spi.java.hints.JavaFix.TransformationContext) methodprotected JavaFix(@NonNull TreePathHandle handle)
TreePathHandle. The base TreePathHandle
will be resolved and passed back to the real implementation of the fix.handle - a TreePathHandle that will be resolved and passed back to the
performRewrite(org.netbeans.spi.java.hints.JavaFix.TransformationContext) method@NonNull protected abstract String getText()
protected abstract void performRewrite(@NonNull JavaFix.TransformationContext ctx) throws Exception
ctx - a context over which the fix should operateException - if something goes wrong while performing the transformation
- will be logged by the infrastructurepublic final Fix toEditorFix()
Fix, that when invoked, will invoke performRewrite(org.netbeans.spi.java.hints.JavaFix.TransformationContext)
method on this JavaFix.Built on May 24 2013. | Portions Copyright 1997-2013 Oracle. All rights reserved.