public class BraceEnforcer extends JavaJspRecursiveElementVisitor
EMPTY_VISITOR
Constructor and Description |
---|
BraceEnforcer(CodeStyleSettings settings) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkElementContainsRange(PsiElement element) |
protected boolean |
checkRangeContainsElement(PsiElement element) |
PsiElement |
process(PsiElement formatted) |
TextRange |
processText(PsiFile source,
TextRange rangeToReformat) |
protected void |
updateResultRange(int oldTextLength,
int newTextLength) |
void |
visitDoWhileStatement(PsiDoWhileStatement statement) |
void |
visitForeachStatement(PsiForeachStatement statement) |
void |
visitForStatement(PsiForStatement statement) |
void |
visitIfStatement(PsiIfStatement statement) |
void |
visitJspFile(JspFile file) |
void |
visitReferenceExpression(PsiReferenceExpression expression)
PsiReferenceExpression is PsiReferenceElement and PsiExpression at the same time.
|
void |
visitWhileStatement(PsiWhileStatement statement) |
visitElement
visitAnnotation, visitAnnotationArrayInitializer, visitAnnotationMethod, visitAnnotationParameterList, visitAnonymousClass, visitArrayAccessExpression, visitArrayInitializerExpression, visitAssertStatement, visitAssignmentExpression, visitBinaryExpression, visitBlockStatement, visitBreakStatement, visitCallExpression, visitCatchSection, visitClass, visitClassInitializer, visitClassObjectAccessExpression, visitCodeBlock, visitCodeFragment, visitConditionalExpression, visitContinueStatement, visitDeclarationStatement, visitDocComment, visitDocTag, visitDocTagValue, visitDocToken, visitEmptyStatement, visitEnumConstant, visitEnumConstantInitializer, visitExpression, visitExpressionList, visitExpressionListStatement, visitExpressionStatement, visitField, visitIdentifier, visitImplicitVariable, visitImportList, visitImportStatement, visitImportStaticReferenceElement, visitImportStaticStatement, visitInlineDocTag, visitInstanceOfExpression, visitJavaFile, visitJavaToken, visitKeyword, visitLabeledStatement, visitLambdaExpression, visitLiteralExpression, visitLocalVariable, visitMethod, visitMethodCallExpression, visitMethodReferenceExpression, visitModifierList, visitModule, visitModuleReferenceElement, visitModuleStatement, visitNameValuePair, visitNewExpression, visitPackage, visitPackageAccessibilityStatement, visitPackageStatement, visitParameter, visitParameterList, visitParenthesizedExpression, visitPattern, visitPatternVariable, visitPolyadicExpression, visitPostfixExpression, visitPrefixExpression, visitProvidesStatement, visitReceiverParameter, visitRecordComponent, visitRecordHeader, visitReferenceElement, visitReferenceList, visitReferenceParameterList, visitRequiresStatement, visitResourceExpression, visitResourceList, visitResourceVariable, visitReturnStatement, visitStatement, visitSuperExpression, visitSwitchExpression, visitSwitchLabeledRuleStatement, visitSwitchLabelStatement, visitSwitchStatement, visitSynchronizedStatement, visitThisExpression, visitThrowStatement, visitTryStatement, visitTypeCastExpression, visitTypeElement, visitTypeParameter, visitTypeParameterList, visitTypeTestPattern, visitUnaryExpression, visitUsesStatement, visitVariable, visitYieldStatement
visitBinaryFile, visitComment, visitDirectory, visitErrorElement, visitFile, visitOuterLanguageElement, visitPlainText, visitPlainTextFile, visitWhiteSpace
public BraceEnforcer(CodeStyleSettings settings)
public void visitReferenceExpression(PsiReferenceExpression expression)
JavaElementVisitor
JavaRecursiveElementVisitor
knows that and implements this method accordingly.
All other visitor must decide themselves what implementation (visitReferenceElement() or visitExpression() or none or LOG.error())
is appropriate for them.visitReferenceExpression
in class JavaJspRecursiveElementVisitor
public void visitIfStatement(PsiIfStatement statement)
visitIfStatement
in class JavaElementVisitor
public void visitForStatement(PsiForStatement statement)
visitForStatement
in class JavaElementVisitor
public void visitForeachStatement(PsiForeachStatement statement)
visitForeachStatement
in class JavaElementVisitor
public void visitWhileStatement(PsiWhileStatement statement)
visitWhileStatement
in class JavaElementVisitor
public void visitDoWhileStatement(PsiDoWhileStatement statement)
visitDoWhileStatement
in class JavaElementVisitor
public void visitJspFile(JspFile file)
visitJspFile
in class JavaJspRecursiveElementVisitor
protected void updateResultRange(int oldTextLength, int newTextLength)
protected boolean checkElementContainsRange(PsiElement element)
protected boolean checkRangeContainsElement(PsiElement element)
public PsiElement process(PsiElement formatted)