Examples of AnnotationExpr


Examples of com.github.antlrjavaparser.api.expr.AnnotationExpr

        if (field.getCommentStructure() != null) {

            // if the field has annotations, add JavaDoc comments to the first
            // annotation
            if (annotations != null && annotations.size() > 0) {
                AnnotationExpr firstAnnotation = annotations.get(0);

                JavaParserCommentMetadataBuilder.updateCommentsToJavaParser(
                        firstAnnotation, field.getCommentStructure());

                // Otherwise, add comments to the field declaration line
View Full Code Here

Examples of com.github.antlrjavaparser.api.expr.AnnotationExpr

            }
        }

        // Create the AnnotationExpr; it varies depending on how many
        // member-value pairs we need to present
        AnnotationExpr annotationExpression = null;
        if (memberValuePairs.isEmpty()) {
            annotationExpression = new MarkerAnnotationExpr(nameToUse);
        }
        else if (memberValuePairs.size() == 1
                && (memberValuePairs.get(0).getName() == null || "value"
View Full Code Here

Examples of com.github.antlrjavaparser.api.expr.AnnotationExpr

    @SuppressWarnings("unchecked")
    private static MemberValuePair convert(
            final AnnotationAttributeValue<?> value) {
        if (value instanceof NestedAnnotationAttributeValue) {
            final NestedAnnotationAttributeValue castValue = (NestedAnnotationAttributeValue) value;
            AnnotationExpr annotationExpr;
            final AnnotationMetadata nestedAnnotation = castValue.getValue();
            if (castValue.getValue().getAttributeNames().size() == 0) {
                annotationExpr = new MarkerAnnotationExpr(
                        JavaParserUtils.getNameExpr(nestedAnnotation
                                .getAnnotationType()
View Full Code Here

Examples of com.github.antlrjavaparser.api.expr.AnnotationExpr

        if (annotationName == null) {
            annotationName = new JavaSymbolName("__ARRAY_ELEMENT__");
        }

        if (expression instanceof AnnotationExpr) {
            final AnnotationExpr annotationExpr = (AnnotationExpr) expression;
            final AnnotationMetadata value = getInstance(annotationExpr,
                    compilationUnitServices).build();
            return new NestedAnnotationAttributeValue(annotationName, value);
        }
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

            }
        }

        // Create the AnnotationExpr; it varies depending on how many
        // member-value pairs we need to present
        AnnotationExpr annotationExpression = null;
        if (memberValuePairs.isEmpty()) {
            annotationExpression = new MarkerAnnotationExpr(nameToUse);
        }
        else if (memberValuePairs.size() == 1
                && (memberValuePairs.get(0).getName() == null || "value"
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

    @SuppressWarnings("unchecked")
    private static MemberValuePair convert(
            final AnnotationAttributeValue<?> value) {
        if (value instanceof NestedAnnotationAttributeValue) {
            final NestedAnnotationAttributeValue castValue = (NestedAnnotationAttributeValue) value;
            AnnotationExpr annotationExpr;
            final AnnotationMetadata nestedAnnotation = castValue.getValue();
            if (castValue.getValue().getAttributeNames().size() == 0) {
                annotationExpr = new MarkerAnnotationExpr(
                        JavaParserUtils.getNameExpr(nestedAnnotation
                                .getAnnotationType()
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

        if (annotationName == null) {
            annotationName = new JavaSymbolName("__ARRAY_ELEMENT__");
        }

        if (expression instanceof AnnotationExpr) {
            final AnnotationExpr annotationExpr = (AnnotationExpr) expression;
            final AnnotationMetadata value = getInstance(annotationExpr,
                    compilationUnitServices).build();
            return new NestedAnnotationAttributeValue(annotationName, value);
        }
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

        throw new Error("Missing return statement in function");
    }

    final public PackageDeclaration PackageDeclaration() throws ParseException {
        List annotations = null;
        AnnotationExpr ann;
        NameExpr name;
        int line;
        int column;
        label_3: while (true) {
            switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

    final public Modifier Modifiers() throws ParseException {
        int beginLine = -1;
        int beginColumn = -1;
        int modifiers = 0;
        List annotations = null;
        AnnotationExpr ann;
        label_4: while (true) {
            if (jj_2_2(2)) {
                ;
            } else {
                break label_4;
            }
            switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case PUBLIC:
                    jj_consume_token(PUBLIC);
                    modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case STATIC:
                    jj_consume_token(STATIC);
                    modifiers = addModifier(modifiers, ModifierSet.STATIC, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case PROTECTED:
                    jj_consume_token(PROTECTED);
                    modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case PRIVATE:
                    jj_consume_token(PRIVATE);
                    modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case FINAL:
                    jj_consume_token(FINAL);
                    modifiers = addModifier(modifiers, ModifierSet.FINAL, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case ABSTRACT:
                    jj_consume_token(ABSTRACT);
                    modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case SYNCHRONIZED:
                    jj_consume_token(SYNCHRONIZED);
                    modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case NATIVE:
                    jj_consume_token(NATIVE);
                    modifiers = addModifier(modifiers, ModifierSet.NATIVE, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case TRANSIENT:
                    jj_consume_token(TRANSIENT);
                    modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case VOLATILE:
                    jj_consume_token(VOLATILE);
                    modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case STRICTFP:
                    jj_consume_token(STRICTFP);
                    modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token);
                    if (beginLine == -1) {
                        beginLine = token.beginLine;
                        beginColumn = token.beginColumn;
                    }
                    break;
                case AT:
                    ann = Annotation();
                    annotations = add(annotations, ann);
                    if (beginLine == -1) {
                        beginLine = ann.getBeginLine();
                        beginColumn = ann.getBeginColumn();
                    }
                    break;
                default:
                    jj_la1[6] = jj_gen;
                    jj_consume_token(-1);
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

        throw new Error("Missing return statement in function");
    }

    final public EnumConstantDeclaration EnumConstantDeclaration() throws ParseException {
        List annotations = null;
        AnnotationExpr ann;
        String name;
        List args = null;
        List classBody = null;
        int line = -1;
        int column = -1;
        pushJavadoc();
        label_9: while (true) {
            switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case AT:
                    ;
                    break;
                default:
                    jj_la1[20] = jj_gen;
                    break label_9;
            }
            ann = Annotation();
            annotations = add(annotations, ann);
            if (line == -1) {
                line = ann.getBeginLine();
                column = ann.getBeginColumn();
            }
        }
        jj_consume_token(IDENTIFIER);
        name = token.image;
        if (line == -1) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.