Package org.springframework.roo.classpath.details.annotations

Examples of org.springframework.roo.classpath.details.annotations.AnnotationMetadata


            members = enumClazz.getMembers();
        }

        if (annotationsList != null) {
            for (final AnnotationExpr candidate : annotationsList) {
                final AnnotationMetadata md = JavaParserAnnotationMetadataBuilder
                        .getInstance(candidate, compilationUnitServices)
                        .build();

                final CommentStructure commentStructure = new CommentStructure();
                JavaParserCommentMetadataBuilder.updateCommentsToRoo(
                        commentStructure, candidate);
                md.setCommentStructure(commentStructure);

                cidBuilder.addAnnotation(md);
            }
        }
View Full Code Here


     * Generates the JPA @Entity annotation to be applied to the entity
     *
     * @return
     */
    private AnnotationMetadata getEntityAnnotation() {
        AnnotationMetadata entityAnnotation = getTypeAnnotation(ENTITY);
        if (entityAnnotation == null) {
            return null;
        }

        if (StringUtils.isNotBlank(annotationValues.getEntityName())) {
View Full Code Here

                // ROO-746: Use @GeneratedValue(strategy = GenerationType.TABLE)
                // If the root of the governor declares @Inheritance(strategy =
                // InheritanceType.TABLE_PER_CLASS)
                if ("AUTO".equals(generationType)) {
                    AnnotationMetadata inheritance = governorTypeDetails
                            .getAnnotation(INHERITANCE);
                    if (inheritance == null) {
                        inheritance = getInheritanceAnnotation();
                    }
                    if (inheritance != null) {
                        final AnnotationAttributeValue<?> value = inheritance
                                .getAttribute(new JavaSymbolName("strategy"));
                        if (value instanceof EnumAttributeValue) {
                            final EnumAttributeValue enumAttributeValue = (EnumAttributeValue) value;
                            final EnumDetails details = enumAttributeValue
                                    .getValue();
View Full Code Here

     *
     * @param annotationValues
     * @return
     */
    private AnnotationMetadata getTableAnnotation() {
        final AnnotationMetadata tableAnnotation = getTypeAnnotation(TABLE);
        if (tableAnnotation == null) {
            return null;
        }
        final String catalog = annotationValues.getCatalog();
        final String schema = annotationValues.getSchema();
View Full Code Here

        else if (value instanceof StringAttributeValue) {
            attributeValue = "\"" + ((StringAttributeValue) value).getValue()
                    + "\"";
        }
        else if (value instanceof NestedAnnotationAttributeValue) {
            final AnnotationMetadata annotationMetadata = ((NestedAnnotationAttributeValue) value)
                    .getValue();
            final StringBuilder data = new StringBuilder("@");
            final JavaType annotationType = annotationMetadata
                    .getAnnotationType();
            if (resolver == null
                    || resolver
                            .isFullyQualifiedFormRequiredAfterAutoImport(annotationType)) {
                data.append(annotationType.getFullyQualifiedTypeName());
            }
            else {
                data.append(annotationType.getSimpleTypeName());
            }
            if (!annotationMetadata.getAttributeNames().isEmpty()) {
                data.append("(");
                int i = 0;
                for (final JavaSymbolName attributeName : annotationMetadata
                        .getAttributeNames()) {
                    i++;
                    if (i > 1) {
                        data.append(", ");
                    }
                    data.append(attributeName.getSymbolName()).append(" = ");
                    data.append(computeAttributeValue(
                            annotationMetadata.getAttribute(attributeName),
                            resolver));
                }
                data.append(")");
            }
            attributeValue = data.toString();
View Full Code Here

    public static AnnotationMetadata getFirstAnnotation(
            final ClassOrInterfaceTypeDetails cid,
            final JavaType... annotationTypes) {
        if (cid != null && annotationTypes != null) {
            for (final JavaType annotationType : annotationTypes) {
                final AnnotationMetadata annotation = MemberFindingUtils
                        .getAnnotationOfType(cid.getAnnotations(),
                                annotationType);
                if (annotation != null) {
                    return annotation;
                }
View Full Code Here

        }
    }

    private Map<String, Object> getAttributeMap(final FieldMetadata field) {
        final Map<String, Object> map = new HashMap<String, Object>();
        final AnnotationMetadata annotationMetadata = getMatchingAnnotation(field);
        if (annotationMetadata != null) {
            for (final JavaSymbolName attributeName : annotationMetadata
                    .getAttributeNames()) {
                map.put(attributeName.getSymbolName(), annotationMetadata
                        .getAttribute(attributeName).getValue());
            }
        }
        return map;
    }
View Full Code Here

   
    private Map<JavaType, String> getDomainTypesToPlurals() {
     
      Map<JavaType, String>  domainTypesToPlurals = new HashMap<JavaType, String> ();
      for (ClassOrInterfaceTypeDetails cid : typeLocationService.findClassesOrInterfaceDetailsWithAnnotation(RooJavaType.ROO_SERVICE)) {
        AnnotationMetadata annotationMetadata = MemberFindingUtils.getAnnotationOfType(cid.getAnnotations(), RooJavaType.ROO_SERVICE);
        AnnotationAttributeValue<Boolean> usePermissionEvaluator = annotationMetadata.getAttribute("usePermissionEvaluator");
        if (usePermissionEvaluator == null || usePermissionEvaluator.getValue() == false){
          continue;
        }
        AnnotationAttributeValue<Collection<ClassAttributeValue>> domainTypes = annotationMetadata.getAttribute("domainTypes");
            for (ClassAttributeValue domainType : domainTypes.getValue()) {
          final ClassOrInterfaceTypeDetails domainTypeDetails = typeLocationService
                      .getTypeDetails(domainType.getValue());
              if (domainTypeDetails == null) {
                  return null;
View Full Code Here

                        compilationUnitServices, pt, fullTypeParameters);
                final List<AnnotationExpr> annotationsList = p.getAnnotations();
                final List<AnnotationMetadata> annotations = new ArrayList<AnnotationMetadata>();
                if (annotationsList != null) {
                    for (final AnnotationExpr candidate : annotationsList) {
                        final AnnotationMetadata annotationMetadata = JavaParserAnnotationMetadataBuilder
                                .getInstance(candidate, compilationUnitServices)
                                .build();
                        annotations.add(annotationMetadata);
                    }
                }
View Full Code Here

        // Create a representation of the desired output ITD
        itdTypeDetails = builder.build();
    }

    private AnnotationMetadata getFacesConverterAnnotation() {
        final AnnotationMetadata annotation = getTypeAnnotation(FACES_CONVERTER);
        if (annotation == null) {
            return null;
        }

        final AnnotationMetadataBuilder annotationBuulder = new AnnotationMetadataBuilder(
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.details.annotations.AnnotationMetadata

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.