private void formatEmptyTypeDeclaration(boolean isFirst) { boolean hasSemiColon = isNextToken(TerminalTokens.TokenNameSEMICOLON); while(isNextToken(TerminalTokens.TokenNameSEMICOLON)) { this.scribe.printComment(); this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); } if (hasSemiColon && isFirst) { this.scribe.printNewLine(); } }
private boolean formatInlineAnnotations(final Annotation[] annotations, boolean spaceBefore) { if (annotations != null ) { if (spaceBefore) this.scribe.space(); int length = annotations.length; for (int i = 0; i < length; ++i) { if (i != 0) this.scribe.space(); annotations[i].traverse(this, (BlockScope)null); } if (length > 0 && (!this.isNextTokenPunctuation() || this.isNextToken(TerminalTokens.TokenNameLBRACKET))) { this.scribe.space(); } if (this.scribe.formatter.preferences.insert_new_line_after_type_annotation) { this.scribe.printNewLine(); } return true; } return false; }
private void formatEmptyTypeDeclaration(boolean isFirst) { boolean hasSemiColon = isNextToken(TerminalTokens.TokenNameSEMICOLON); while(isNextToken(TerminalTokens.TokenNameSEMICOLON)) { this.scribe.printComment(); this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); } if (hasSemiColon && isFirst) { this.scribe.printNewLine(); } }
private boolean formatInlineAnnotations(final Annotation[] annotations, boolean spaceBefore) { if (annotations != null ) { if (spaceBefore) this.scribe.space(); int length = annotations.length; for (int i = 0; i < length; ++i) { if (i != 0) this.scribe.space(); annotations[i].traverse(this, (BlockScope)null); } if (length > 0 && (!this.isNextTokenPunctuation() || this.isNextToken(TerminalTokens.TokenNameLBRACKET))) { this.scribe.space(); } if (this.scribe.formatter.preferences.insert_new_line_after_type_annotation) { this.scribe.printNewLine(); } return true; } return false; }
private void formatEmptyTypeDeclaration(boolean isFirst) { boolean hasSemiColon = isNextToken(TerminalTokens.TokenNameSEMICOLON); while(isNextToken(TerminalTokens.TokenNameSEMICOLON)) { this.scribe.printComment(); this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); } if (hasSemiColon && isFirst) { this.scribe.printNewLine(); } }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.IntLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(IntLiteral intLiteral, BlockScope scope) { final int numberOfParens = (intLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(intLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameIntegerLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(intLiteral, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.FloatLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(FloatLiteral floatLiteral, BlockScope scope) { final int numberOfParens = (floatLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(floatLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameFloatingPointLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(floatLiteral, numberOfParens); } return false; } public boolean visit(ForeachStatement forStatement, BlockScope scope) {
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.DoubleLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) { final int numberOfParens = (doubleLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(doubleLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameDoubleLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(doubleLiteral, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.DoubleLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) { final int numberOfParens = (doubleLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(doubleLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameDoubleLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(doubleLiteral, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.FloatLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(FloatLiteral floatLiteral, BlockScope scope) { final int numberOfParens = (floatLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(floatLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameFloatingPointLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(floatLiteral, numberOfParens); } return false; } public boolean visit(ForeachStatement forStatement, BlockScope scope) {
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.LongLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(LongLiteral longLiteral, BlockScope scope) { final int numberOfParens = (longLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(longLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameLongLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(longLiteral, numberOfParens); } return false; } public boolean visit(MarkerAnnotation annotation, BlockScope scope) {
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.IntLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(IntLiteral intLiteral, BlockScope scope) { final int numberOfParens = (intLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(intLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameIntegerLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(intLiteral, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.LongLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(LongLiteral longLiteral, BlockScope scope) { final int numberOfParens = (longLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(longLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameLongLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(longLiteral, numberOfParens); } return false; } public boolean visit(MarkerAnnotation annotation, BlockScope scope) {
manageOpeningParenthesizedExpression(lambdaExpression, numberOfParens); if (isNextToken(TerminalTokens.TokenNameLPAREN)) {
manageOpeningParenthesizedExpression(lambdaExpression, numberOfParens); if (isNextToken(TerminalTokens.TokenNameLPAREN)) {
int methodDeclarationParametersAlignment) { if (!isNextToken(TerminalTokens.TokenNameLPAREN)) { return;
int methodDeclarationParametersAlignment) { if (!isNextToken(TerminalTokens.TokenNameLPAREN)) { return;
int methodDeclarationParametersAlignment) { if (!isNextToken(TerminalTokens.TokenNameLPAREN)) { return;
format((TypeDeclaration)member, null, isChunkStart, i == 0); while (isNextToken(TerminalTokens.TokenNameSEMICOLON)) { this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
format((TypeDeclaration)member, null, isChunkStart, i == 0); while (isNextToken(TerminalTokens.TokenNameSEMICOLON)) { this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);