@Override public Void visitSwitchStatement(final SwitchStatement node, final Void ignored) { startNode(node); writeKeyword(SwitchStatement.SWITCH_KEYWORD_ROLE); space(policy.SpaceBeforeSwitchParentheses); leftParenthesis(); space(policy.SpacesWithinSwitchParentheses); node.getExpression().acceptVisitor(this, ignored); space(policy.SpacesWithinSwitchParentheses); rightParenthesis(); openBrace(policy.StatementBraceStyle); if (policy.IndentSwitchBody) { formatter.indent(); } for (final SwitchSection section : node.getSwitchSections()) { section.acceptVisitor(this, ignored); } if (policy.IndentSwitchBody) { formatter.unindent(); } closeBrace(policy.StatementBraceStyle); newLine(); endNode(node); return null; }
@Override public Void visitSwitchStatement(final SwitchStatement node, final Void ignored) { startNode(node); writeKeyword(SwitchStatement.SWITCH_KEYWORD_ROLE); space(policy.SpaceBeforeSwitchParentheses); leftParenthesis(); space(policy.SpacesWithinSwitchParentheses); node.getExpression().acceptVisitor(this, ignored); space(policy.SpacesWithinSwitchParentheses); rightParenthesis(); openBrace(policy.StatementBraceStyle); if (policy.IndentSwitchBody) { formatter.indent(); } for (final SwitchSection section : node.getSwitchSections()) { section.acceptVisitor(this, ignored); } if (policy.IndentSwitchBody) { formatter.unindent(); } closeBrace(policy.StatementBraceStyle); newLine(); endNode(node); return null; }
@Override public Void visitSwitchStatement(final SwitchStatement node, final Void ignored) { startNode(node); writeKeyword(SwitchStatement.SWITCH_KEYWORD_ROLE); space(policy.SpaceBeforeSwitchParentheses); leftParenthesis(); space(policy.SpacesWithinSwitchParentheses); node.getExpression().acceptVisitor(this, ignored); space(policy.SpacesWithinSwitchParentheses); rightParenthesis(); openBrace(policy.StatementBraceStyle); if (policy.IndentSwitchBody) { formatter.indent(); } for (final SwitchSection section : node.getSwitchSections()) { section.acceptVisitor(this, ignored); } if (policy.IndentSwitchBody) { formatter.unindent(); } closeBrace(policy.StatementBraceStyle); newLine(); endNode(node); return null; }