Java 类org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation 实例源码

项目:lombok    文件:EclipseHandlerUtil.java   
public static Annotation[] createSuppressWarningsAll(ASTNode source, Annotation[] originalAnnotationArray) {
    int pS = source.sourceStart, pE = source.sourceEnd;
    long p = (long)pS << 32 | pE;
    long[] poss = new long[3];
    Arrays.fill(poss, p);
    QualifiedTypeReference suppressWarningsType = new QualifiedTypeReference(TypeConstants.JAVA_LANG_SUPPRESSWARNINGS, poss);
    setGeneratedBy(suppressWarningsType, source);
    SingleMemberAnnotation ann = new SingleMemberAnnotation(suppressWarningsType, pS);
    ann.declarationSourceEnd = pE;
    ann.memberValue = new StringLiteral(ALL, pS, pE, 0);
    setGeneratedBy(ann, source);
    setGeneratedBy(ann.memberValue, source);
    if (originalAnnotationArray == null) return new Annotation[] { ann };
    Annotation[] newAnnotationArray = new Annotation[originalAnnotationArray.length + 1];
    System.arraycopy(originalAnnotationArray, 0, newAnnotationArray, 0, originalAnnotationArray.length);
    newAnnotationArray[originalAnnotationArray.length] = ann;
    return newAnnotationArray;
}
项目:lombok-ianchiu    文件:HandleConstructor.java   
public static Annotation[] createConstructorProperties(ASTNode source, Collection<EclipseNode> fields) {
    if (fields.isEmpty()) return null;

    int pS = source.sourceStart, pE = source.sourceEnd;
    long p = (long) pS << 32 | pE;
    long[] poss = new long[3];
    Arrays.fill(poss, p);
    QualifiedTypeReference constructorPropertiesType = new QualifiedTypeReference(JAVA_BEANS_CONSTRUCTORPROPERTIES, poss);
    setGeneratedBy(constructorPropertiesType, source);
    SingleMemberAnnotation ann = new SingleMemberAnnotation(constructorPropertiesType, pS);
    ann.declarationSourceEnd = pE;

    ArrayInitializer fieldNames = new ArrayInitializer();
    fieldNames.sourceStart = pS;
    fieldNames.sourceEnd = pE;
    fieldNames.expressions = new Expression[fields.size()];

    int ctr = 0;
    for (EclipseNode field : fields) {
        char[] fieldName = removePrefixFromField(field);
        fieldNames.expressions[ctr] = new StringLiteral(fieldName, pS, pE, 0);
        setGeneratedBy(fieldNames.expressions[ctr], source);
        ctr++;
    }

    ann.memberValue = fieldNames;
    setGeneratedBy(ann, source);
    setGeneratedBy(ann.memberValue, source);
    return new Annotation[] { ann };
}
项目:EasyMPermission    文件:HandleConstructor.java   
public static Annotation[] createConstructorProperties(ASTNode source, Collection<EclipseNode> fields) {
    if (fields.isEmpty()) return null;

    int pS = source.sourceStart, pE = source.sourceEnd;
    long p = (long)pS << 32 | pE;
    long[] poss = new long[3];
    Arrays.fill(poss, p);
    QualifiedTypeReference constructorPropertiesType = new QualifiedTypeReference(JAVA_BEANS_CONSTRUCTORPROPERTIES, poss);
    setGeneratedBy(constructorPropertiesType, source);
    SingleMemberAnnotation ann = new SingleMemberAnnotation(constructorPropertiesType, pS);
    ann.declarationSourceEnd = pE;

    ArrayInitializer fieldNames = new ArrayInitializer();
    fieldNames.sourceStart = pS;
    fieldNames.sourceEnd = pE;
    fieldNames.expressions = new Expression[fields.size()];

    int ctr = 0;
    for (EclipseNode field : fields) {
        char[] fieldName = removePrefixFromField(field);
        fieldNames.expressions[ctr] = new StringLiteral(fieldName, pS, pE, 0);
        setGeneratedBy(fieldNames.expressions[ctr], source);
        ctr++;
    }

    ann.memberValue = fieldNames;
    setGeneratedBy(ann, source);
    setGeneratedBy(ann.memberValue, source);
    return new Annotation[] { ann };
}
项目:Eclipse-Postfix-Code-Completion    文件:CodeFormatterVisitor.java   
public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
    this.scribe.printNextToken(TerminalTokens.TokenNameAT);
    if (this.preferences.insert_space_after_at_in_annotation) {
        this.scribe.space();
    }
    this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/);
    this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_annotation);
    if (this.preferences.insert_space_after_opening_paren_in_annotation) {
        this.scribe.space();
    }
    annotation.memberValue.traverse(this, scope);
    this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation);
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CodeFormatterVisitor.java   
public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
    this.scribe.printNextToken(TerminalTokens.TokenNameAT);
    if (this.preferences.insert_space_after_at_in_annotation) {
        this.scribe.space();
    }
    this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/);
    this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_annotation);
    if (this.preferences.insert_space_after_opening_paren_in_annotation) {
        this.scribe.space();
    }
    annotation.memberValue.traverse(this, scope);
    this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation);
    return false;
}
项目:lombok    文件:HandleConstructor.java   
private static Annotation[] createConstructorProperties(ASTNode source, Collection<EclipseNode> fields) {
    if (fields.isEmpty()) return null;

    int pS = source.sourceStart, pE = source.sourceEnd;
    long p = (long)pS << 32 | pE;
    long[] poss = new long[3];
    Arrays.fill(poss, p);
    QualifiedTypeReference constructorPropertiesType = new QualifiedTypeReference(JAVA_BEANS_CONSTRUCTORPROPERTIES, poss);
    setGeneratedBy(constructorPropertiesType, source);
    SingleMemberAnnotation ann = new SingleMemberAnnotation(constructorPropertiesType, pS);
    ann.declarationSourceEnd = pE;

    ArrayInitializer fieldNames = new ArrayInitializer();
    fieldNames.sourceStart = pS;
    fieldNames.sourceEnd = pE;
    fieldNames.expressions = new Expression[fields.size()];

    int ctr = 0;
    for (EclipseNode field : fields) {
        fieldNames.expressions[ctr] = new StringLiteral(field.getName().toCharArray(), pS, pE, 0);
        setGeneratedBy(fieldNames.expressions[ctr], source);
        ctr++;
    }

    ann.memberValue = fieldNames;
    setGeneratedBy(ann, source);
    setGeneratedBy(ann.memberValue, source);
    return new Annotation[] { ann };
}
项目:lombok-ianchiu    文件:SetGeneratedByVisitor.java   
@Override public boolean visit(SingleMemberAnnotation node, BlockScope scope) {
    fixPositions(setGeneratedBy(node, source));
    return super.visit(node, scope);
}
项目:EasyMPermission    文件:SetGeneratedByVisitor.java   
@Override public boolean visit(SingleMemberAnnotation node, BlockScope scope) {
    fixPositions(setGeneratedBy(node, source));
    return super.visit(node, scope);
}
项目:xapi    文件:GwtAstBuilder.java   
@Override
public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
  return false;
}
项目:lombok    文件:SetGeneratedByVisitor.java   
@Override public boolean visit(SingleMemberAnnotation node, BlockScope scope) {
    setGeneratedBy(node, source);
    applyOffset(node);
    return super.visit(node, scope);
}