Package com.sun.tools.javac.tree.JCTree

Examples of com.sun.tools.javac.tree.JCTree.JCAnnotation


     * Attribute the type references in a list of annotations.
     */
    void attribAnnotationTypes(List<JCAnnotation> annotations,
                               Env<AttrContext> env) {
        for (List<JCAnnotation> al = annotations; al.nonEmpty(); al = al.tail) {
            JCAnnotation a = al.head;
            attribType(a.annotationType, env);
        }
    }
View Full Code Here


        if (isInstantiation()) {
            primary = gen.makeJavaType(getAnnotationClassType());
        } else {
            primary = gen.naming.makeName((Method)getPrimary(), Naming.NA_FQ | Naming.NA_WRAPPER);
        }
        JCAnnotation atInstantiation = gen.make().Annotation(
                gen.make().Type(gen.syms().ceylonAtAnnotationInstantiationType),
                com.sun.tools.javac.util.List.<JCExpression>of(
                        gen.make().Assign(
                                gen.naming.makeUnquotedIdent("arguments"),
                                gen.make().NewArray(null, null, arguments.toList())),
View Full Code Here

        }
        ListBuffer<JCAnnotation> result = ListBuffer.lb();
        for (Class annotationClass : annotationSet.keySet()) {
            ListBuffer<JCAnnotation> annotations = annotationSet.get(annotationClass);
            if (isSequencedAnnotation(annotationClass)) {
                JCAnnotation wrapperAnnotation = make().Annotation(
                        makeJavaType(annotationClass.getType(), JT_ANNOTATIONS),
                        List.<JCExpression>of(make().NewArray(null,  null, (List)annotations.toList())));
                result.append(wrapperAnnotation);
            } else {
                if (annotations.size() > 1) {
View Full Code Here

   
    void transformAnnotation(Tree.Annotation invocation,
            Map<Class, ListBuffer<JCAnnotation>> annotationSet) {
        at(invocation);
        try {
            JCAnnotation annotation = AnnotationInvocationVisitor.transformConstructor(this, invocation);
            if (annotation != null) {
                Class annotationClass = AnnotationInvocationVisitor.annoClass(invocation);
                putAnnotation(annotationSet, annotation, annotationClass);
            }
        } catch (BugException e) {
View Full Code Here

    }


    public void transformAnonymousAnnotation(Tree.AnonymousAnnotation annotation, Map<Class, ListBuffer<JCAnnotation>> annos) {
        ProducedType docType = ((TypeDeclaration)typeFact().getLanguageModuleDeclaration("DocAnnotation")).getType();
        JCAnnotation docAnnotation = at(annotation).Annotation(
                makeJavaType(docType,  JT_ANNOTATION),
                List.<JCExpression>of(make().Assign(naming.makeUnquotedIdent("description"),
                        transform(annotation.getStringLiteral()))));
        putAnnotation(annos, docAnnotation, (Class)docType.getDeclaration());
    }
View Full Code Here

                        exprGen.make().NewArray(null, null, exprs.toList())));
            }
           
        }
       
        JCAnnotation annotation = exprGen.at(invocation).Annotation(
                ai.makeAnnotationType(exprGen),
                assignments.toList());
        return annotation;
    }
View Full Code Here

            if (Util.getAnnotation(dependency, "optional") != null) {
                JCExpression exported = make().Assign(naming.makeUnquotedIdent("optional"), make().Literal(true));
                spec = spec.append(exported);
            }
           
            JCAnnotation atImport = make().Annotation(makeIdent(syms().ceylonAtImportType), spec);
            imports.add(atImport);
        }

        ListBuffer<JCExpression> annotationArgs = getLicenseAuthorsDocAnnotationArguments(
                module.getNameAsString(), module.getAnnotations());
View Full Code Here

                JCExpression argNameAttribute = make().Assign(naming.makeUnquotedIdent("name"),
                        make().Literal(entry.getKey()));
                JCExpression argValueAttribute = make().Assign(naming.makeUnquotedIdent("value"),
                        make().Literal(entry.getValue()));

                JCAnnotation namedArg = make().Annotation(makeIdent(syms().ceylonAtNamedArgumentType),
                                                          List.of(argNameAttribute, argValueAttribute));
                array.add(namedArg);
            }
            JCExpression argumentsAttribute = make().Assign(naming.makeUnquotedIdent("namedArguments"),
                    make().NewArray(null, null, array.toList()));
View Full Code Here

                TransformationPlan plan = errors().hasDeclarationAndMarkBrokenness(innerTypeTree);
                if (plan instanceof Drop) {
                    continue;
                }
            }
            JCAnnotation atMember = makeAtMember(innerType.getType());
            members = members.prepend(atMember);
        }
        classBuilder.annotations(makeAtMembers(members));
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.tree.JCTree.JCAnnotation

Copyright © 2018 www.massapicom. 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.