| Constructor and Description |
|---|
JavaFixUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static Fix |
removeFromParent(HintContext ctx,
String displayName,
TreePath what)
Creates a fix that removes the given code corresponding to the given tree
node from the source code.
|
static boolean |
requiresParenthesis(Tree inner,
Tree original,
Tree outter)
Checks whether putting
inner tree into outter tree,
when original is being replaced with inner requires parentheses. |
static Fix |
rewriteFix(HintContext ctx,
String displayName,
TreePath what,
String to)
Prepare a fix that will replace the given tree node (
what) with the
given code. |
public static Fix rewriteFix(HintContext ctx, String displayName, TreePath what, String to)
what) with the
given code. Any variables in the to pattern will be replaced with their
values from HintContext.getVariables(), HintContext.getMultiVariables()
and HintContext.getVariableNames().ctx - basic context for which the fix should be createddisplayName - the display name of the fixwhat - the tree node that should be replacedto - the new code that should replaced the what tree nodepublic static Fix removeFromParent(HintContext ctx, String displayName, TreePath what)
ctx - basic context for which the fix should be createddisplayName - the display name of the fixwhat - the tree node that should be removedpublic static boolean requiresParenthesis(Tree inner, Tree original, Tree outter)
inner tree into outter tree,
when original is being replaced with inner requires parentheses.inner - the new tree node that will be placed under outteroriginal - the tree node that is being replaced with inneroutter - the future parent node of innerTreeMaker.Parenthesized(com.sun.source.tree.ExpressionTree)
to keep the original meaning.Built on June 18 2013. | Portions Copyright 1997-2013 Oracle. All rights reserved.