private void formatQualifiedTypeReference(QualifiedTypeReference qualifiedTypeReference) { for (int i = 0, length = qualifiedTypeReference.tokens.length; i < length; ++i) { if (i != 0) this.scribe.printNextToken(TerminalTokens.TokenNameDOT, false); if (qualifiedTypeReference.annotations != null) { formatInlineAnnotations(qualifiedTypeReference.annotations[i], false); this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false); } else { this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false); } } }
private void formatQualifiedTypeReference(QualifiedTypeReference qualifiedTypeReference) { for (int i = 0, length = qualifiedTypeReference.tokens.length; i < length; ++i) { if (i != 0) this.scribe.printNextToken(TerminalTokens.TokenNameDOT, false); if (qualifiedTypeReference.annotations != null) { formatInlineAnnotations(qualifiedTypeReference.annotations[i], false); this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false); } else { this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false); } } }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.SingleTypeReference, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit( SingleTypeReference singleTypeReference, BlockScope scope) { final int numberOfParens = (singleTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(singleTypeReference, numberOfParens); } if (singleTypeReference.annotations != null) { formatInlineAnnotations(singleTypeReference.annotations[0], false); } this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS); if (numberOfParens > 0) { manageClosingParenthesizedExpression(singleTypeReference, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.SingleTypeReference, org.eclipse.jdt.internal.compiler.lookup.ClassScope) */ public boolean visit( SingleTypeReference singleTypeReference, ClassScope scope) { final int numberOfParens = (singleTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(singleTypeReference, numberOfParens); } if (singleTypeReference.annotations != null) { formatInlineAnnotations(singleTypeReference.annotations[0], false); } this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS); if (numberOfParens > 0) { manageClosingParenthesizedExpression(singleTypeReference, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.SingleTypeReference, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit( SingleTypeReference singleTypeReference, BlockScope scope) { final int numberOfParens = (singleTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(singleTypeReference, numberOfParens); } if (singleTypeReference.annotations != null) { formatInlineAnnotations(singleTypeReference.annotations[0], false); } this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS); if (numberOfParens > 0) { manageClosingParenthesizedExpression(singleTypeReference, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.SingleTypeReference, org.eclipse.jdt.internal.compiler.lookup.ClassScope) */ public boolean visit( SingleTypeReference singleTypeReference, ClassScope scope) { final int numberOfParens = (singleTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(singleTypeReference, numberOfParens); } if (singleTypeReference.annotations != null) { formatInlineAnnotations(singleTypeReference.annotations[0], false); } this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS); if (numberOfParens > 0) { manageClosingParenthesizedExpression(singleTypeReference, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference, org.eclipse.jdt.internal.compiler.lookup.ClassScope) */ public boolean visit( ArrayTypeReference arrayTypeReference, ClassScope scope) { final int numberOfParens = (arrayTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(arrayTypeReference, numberOfParens); } if (arrayTypeReference.annotations != null) { formatInlineAnnotations(arrayTypeReference.annotations[0], false); } this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS); int dimensions = getDimensions(); if (dimensions != 0) { formatDimensions(arrayTypeReference, 0, dimensions); } if (numberOfParens > 0) { manageClosingParenthesizedExpression(arrayTypeReference, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit( ArrayTypeReference arrayTypeReference, BlockScope scope) { final int numberOfParens = (arrayTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(arrayTypeReference, numberOfParens); } if (arrayTypeReference.annotations != null) { formatInlineAnnotations(arrayTypeReference.annotations[0], false); } this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS); int dimensions = getDimensions(); if (dimensions != 0) { formatDimensions(arrayTypeReference, 0, dimensions); } if (numberOfParens > 0) { manageClosingParenthesizedExpression(arrayTypeReference, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference, org.eclipse.jdt.internal.compiler.lookup.ClassScope) */ public boolean visit( ArrayTypeReference arrayTypeReference, ClassScope scope) { final int numberOfParens = (arrayTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(arrayTypeReference, numberOfParens); } if (arrayTypeReference.annotations != null) { formatInlineAnnotations(arrayTypeReference.annotations[0], false); } this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS); int dimensions = getDimensions(); if (dimensions != 0) { formatDimensions(arrayTypeReference, 0, dimensions); } if (numberOfParens > 0) { manageClosingParenthesizedExpression(arrayTypeReference, numberOfParens); } return false; }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit( ArrayTypeReference arrayTypeReference, BlockScope scope) { final int numberOfParens = (arrayTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(arrayTypeReference, numberOfParens); } if (arrayTypeReference.annotations != null) { formatInlineAnnotations(arrayTypeReference.annotations[0], false); } this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS); int dimensions = getDimensions(); if (dimensions != 0) { formatDimensions(arrayTypeReference, 0, dimensions); } if (numberOfParens > 0) { manageClosingParenthesizedExpression(arrayTypeReference, numberOfParens); } return false; }
private void formatDimensions(TypeReference typeReference, int anchor, int count) { if (count != 0) { if (this.preferences.insert_space_before_opening_bracket_in_array_type_reference) { this.scribe.space(); } Annotation[][] annotationsOnDimensions = typeReference != null ? typeReference.getAnnotationsOnDimensions(true) : null; for (int i = 0; i < count; i++) { int dimensionIndex = anchor + i; if (annotationsOnDimensions != null && annotationsOnDimensions.length > dimensionIndex) { boolean hadAnnotations = formatInlineAnnotations(annotationsOnDimensions[dimensionIndex], true); if (hadAnnotations && this.preferences.insert_space_before_opening_bracket_in_array_type_reference) this.scribe.space(); } this.scribe.printNextToken(TerminalTokens.TokenNameLBRACKET); if (this.preferences.insert_space_between_brackets_in_array_type_reference) { this.scribe.space(); } this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET); } } }
private void formatDimensions(TypeReference typeReference, int anchor, int count) { if (count != 0) { if (this.preferences.insert_space_before_opening_bracket_in_array_type_reference) { this.scribe.space(); } Annotation[][] annotationsOnDimensions = typeReference != null ? typeReference.getAnnotationsOnDimensions(true) : null; for (int i = 0; i < count; i++) { int dimensionIndex = anchor + i; if (annotationsOnDimensions != null && annotationsOnDimensions.length > dimensionIndex) { boolean hadAnnotations = formatInlineAnnotations(annotationsOnDimensions[dimensionIndex], true); if (hadAnnotations && this.preferences.insert_space_before_opening_bracket_in_array_type_reference) this.scribe.space(); } this.scribe.printNextToken(TerminalTokens.TokenNameLBRACKET); if (this.preferences.insert_space_between_brackets_in_array_type_reference) { this.scribe.space(); } this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET); } } }
public boolean visit(Wildcard wildcard, BlockScope scope) { if (wildcard.annotations != null) { if (formatInlineAnnotations(wildcard.annotations[0], false)) this.scribe.space(); } this.scribe.printNextToken(TerminalTokens.TokenNameQUESTION, this.preferences.insert_space_before_question_in_wilcard); switch(wildcard.kind) { case Wildcard.SUPER : this.scribe.printNextToken(TerminalTokens.TokenNamesuper, true); this.scribe.space(); wildcard.bound.traverse(this, scope); break; case Wildcard.EXTENDS : this.scribe.printNextToken(TerminalTokens.TokenNameextends, true); this.scribe.space(); wildcard.bound.traverse(this, scope); break; case Wildcard.UNBOUND : if (this.preferences.insert_space_after_question_in_wilcard) { this.scribe.space(); } } return false; } public boolean visit(Wildcard wildcard, ClassScope scope) {
public boolean visit(Wildcard wildcard, ClassScope scope) { if (wildcard.annotations != null) { if (formatInlineAnnotations(wildcard.annotations[0], false)) this.scribe.space(); } this.scribe.printNextToken(TerminalTokens.TokenNameQUESTION, this.preferences.insert_space_before_question_in_wilcard); switch(wildcard.kind) { case Wildcard.SUPER : this.scribe.printNextToken(TerminalTokens.TokenNamesuper, true); this.scribe.space(); wildcard.bound.traverse(this, scope); break; case Wildcard.EXTENDS : this.scribe.printNextToken(TerminalTokens.TokenNameextends, true); this.scribe.space(); wildcard.bound.traverse(this, scope); break; case Wildcard.UNBOUND : if (this.preferences.insert_space_after_question_in_wilcard) { this.scribe.space(); } } return false; } }
public boolean visit(Wildcard wildcard, ClassScope scope) { if (wildcard.annotations != null) { if (formatInlineAnnotations(wildcard.annotations[0], false)) this.scribe.space(); } this.scribe.printNextToken(TerminalTokens.TokenNameQUESTION, this.preferences.insert_space_before_question_in_wilcard); switch(wildcard.kind) { case Wildcard.SUPER : this.scribe.printNextToken(TerminalTokens.TokenNamesuper, true); this.scribe.space(); wildcard.bound.traverse(this, scope); break; case Wildcard.EXTENDS : this.scribe.printNextToken(TerminalTokens.TokenNameextends, true); this.scribe.space(); wildcard.bound.traverse(this, scope); break; case Wildcard.UNBOUND : if (this.preferences.insert_space_after_question_in_wilcard) { this.scribe.space(); } } return false; } }
public boolean visit(Wildcard wildcard, BlockScope scope) { if (wildcard.annotations != null) { if (formatInlineAnnotations(wildcard.annotations[0], false)) this.scribe.space(); } this.scribe.printNextToken(TerminalTokens.TokenNameQUESTION, this.preferences.insert_space_before_question_in_wilcard); switch(wildcard.kind) { case Wildcard.SUPER : this.scribe.printNextToken(TerminalTokens.TokenNamesuper, true); this.scribe.space(); wildcard.bound.traverse(this, scope); break; case Wildcard.EXTENDS : this.scribe.printNextToken(TerminalTokens.TokenNameextends, true); this.scribe.space(); wildcard.bound.traverse(this, scope); break; case Wildcard.UNBOUND : if (this.preferences.insert_space_after_question_in_wilcard) { this.scribe.space(); } } return false; } public boolean visit(Wildcard wildcard, ClassScope scope) {
public boolean visit(TypeParameter typeParameter, ClassScope scope) { if (typeParameter.annotations != null) { formatInlineAnnotations(typeParameter.annotations, false); } this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); if (typeParameter.type != null) { this.scribe.space(); this.scribe.printNextToken(TerminalTokens.TokenNameextends, true); this.scribe.space(); typeParameter.type.traverse(this, scope); } final TypeReference[] bounds = typeParameter.bounds; if (bounds != null) { this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter); if (this.preferences.insert_space_after_and_in_type_parameter) { this.scribe.space(); } int boundsLength = bounds.length; for (int i = 0; i < boundsLength - 1; i++) { bounds[i].traverse(this, scope); this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter); if (this.preferences.insert_space_after_and_in_type_parameter) { this.scribe.space(); } } bounds[boundsLength - 1].traverse(this, scope); } return false; }
public boolean visit(TypeParameter typeParameter, BlockScope scope) { if (typeParameter.annotations != null) { formatInlineAnnotations(typeParameter.annotations, false); } this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); if (typeParameter.type != null) { this.scribe.space(); this.scribe.printNextToken(TerminalTokens.TokenNameextends, true); this.scribe.space(); typeParameter.type.traverse(this, scope); } final TypeReference[] bounds = typeParameter.bounds; if (bounds != null) { this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter); if (this.preferences.insert_space_after_and_in_type_parameter) { this.scribe.space(); } int boundsLength = bounds.length; for (int i = 0; i < boundsLength - 1; i++) { bounds[i].traverse(this, scope); this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter); if (this.preferences.insert_space_after_and_in_type_parameter) { this.scribe.space(); } } bounds[boundsLength - 1].traverse(this, scope); } return false; } public boolean visit(TypeParameter typeParameter, ClassScope scope) {
public boolean visit(TypeParameter typeParameter, ClassScope scope) { if (typeParameter.annotations != null) { formatInlineAnnotations(typeParameter.annotations, false); } this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); if (typeParameter.type != null) { this.scribe.space(); this.scribe.printNextToken(TerminalTokens.TokenNameextends, true); this.scribe.space(); typeParameter.type.traverse(this, scope); } final TypeReference[] bounds = typeParameter.bounds; if (bounds != null) { this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter); if (this.preferences.insert_space_after_and_in_type_parameter) { this.scribe.space(); } int boundsLength = bounds.length; for (int i = 0; i < boundsLength - 1; i++) { bounds[i].traverse(this, scope); this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter); if (this.preferences.insert_space_after_and_in_type_parameter) { this.scribe.space(); } } bounds[boundsLength - 1].traverse(this, scope); } return false; }
public boolean visit(TypeParameter typeParameter, BlockScope scope) { if (typeParameter.annotations != null) { formatInlineAnnotations(typeParameter.annotations, false); } this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); if (typeParameter.type != null) { this.scribe.space(); this.scribe.printNextToken(TerminalTokens.TokenNameextends, true); this.scribe.space(); typeParameter.type.traverse(this, scope); } final TypeReference[] bounds = typeParameter.bounds; if (bounds != null) { this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter); if (this.preferences.insert_space_after_and_in_type_parameter) { this.scribe.space(); } int boundsLength = bounds.length; for (int i = 0; i < boundsLength - 1; i++) { bounds[i].traverse(this, scope); this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter); if (this.preferences.insert_space_after_and_in_type_parameter) { this.scribe.space(); } } bounds[boundsLength - 1].traverse(this, scope); } return false; } public boolean visit(TypeParameter typeParameter, ClassScope scope) {