Examples of AnnotationMetadata


Examples of org.springframework.core.type.AnnotationMetadata

            final Resource[] resources = resolver.getResources(packageSearchPath);   
           
           
            for (final Resource resource: resources) {
                final MetadataReader reader = factory.getMetadataReader(resource);
                final AnnotationMetadata metadata = reader.getAnnotationMetadata();
               
                if (scanAllPackages && shouldSkip(metadata.getClassName())) {
                    continue;
                }
               
                for (Class< ? extends Annotation > annotation: annotations) {
                    boolean concreteClass = !metadata.isInterface() && !metadata.isAbstract();
                    if (metadata.isAnnotated(annotation.getName())) {
                        if (concreteClass) {
                            classes.get(annotation).add(loadClass(metadata.getClassName(), loader));
                        } else {
                            matchingInterfaces.get(annotation).add(metadata.getClassName());   
                        }
                    } else if (concreteClass && metadata.getInterfaceNames().length > 0) {
                        nonMatchingClasses.put(metadata.getClassName(), metadata.getInterfaceNames());
                    }
                }
            }
        }
        if (!nonMatchingClasses.isEmpty()) {
View Full Code Here

Examples of org.springframework.core.type.AnnotationMetadata

   * Derive a bean name from one of the annotations on the class.
   * @param annotatedDef the annotation-aware bean definition
   * @return the bean name, or <code>null</code> if none is found
   */
  protected String determineBeanNameFromAnnotation(AnnotatedBeanDefinition annotatedDef) {
    AnnotationMetadata amd = annotatedDef.getMetadata();
    Set<String> types = amd.getAnnotationTypes();
    String beanName = null;
    for (String type : types) {
      Map<String, Object> attributes = amd.getAnnotationAttributes(type);
      if (isStereotypeWithNameValue(type, amd.getMetaAnnotationTypes(type), attributes)) {
        String value = (String) attributes.get("value");
        if (StringUtils.hasLength(value)) {
          if (beanName != null && !value.equals(beanName)) {
            throw new IllegalStateException("Stereotype annotations suggest inconsistent " +
                "component names: '" + beanName + "' versus '" + value + "'");
View Full Code Here

Examples of org.springframework.core.type.AnnotationMetadata

                // ignore not readable classes and closures
                if(!resource.isReadable() || resource.getFilename().contains("$_")) continue;
                try {

                    MetadataReader metadataReader = readerFactory.getMetadataReader(new GrailsResource(resource));
                    AnnotationMetadata annotationMetadata = metadataReader.getAnnotationMetadata();
                    if(annotationMetadata.hasAnnotation(AstTransformer.class.getName()) || annotationMetadata.hasAnnotation(org.codehaus.groovy.grails.compiler.injection.AstTransformer.class.getName())) {
                        String className = metadataReader.getClassMetadata().getClassName();
                        Class<?> injectorClass = classLoader.loadClass(className);
                        if(injectorClasses.contains(injectorClass)) continue;
                        if (ClassInjector.class.isAssignableFrom(injectorClass)) {
View Full Code Here

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
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.