Package org.scannotation

Examples of org.scannotation.AnnotationDB.scanArchives()


         db.setScanFieldAnnotations(false);
         db.setScanMethodAnnotations(false);
         db.setScanParameterAnnotations(false);
         try
         {
            db.scanArchives(urls);
            try
            {
               db.crossReferenceImplementedInterfaces();
               db.crossReferenceMetaAnnotations();
            }
View Full Code Here


    public void execute() throws MojoExecutionException, MojoFailureException {
        try {
            final JSONObject descriptor = new JSONObject();

            final AnnotationDB annotationDb = new AnnotationDB();
            annotationDb.scanArchives(buildOutputDirectory.toURI().toURL());

            final Set<String> annotatedClassNames = new HashSet<String>();
            addAnnotatedClasses(annotationDb, annotatedClassNames, Adaptable.class);
            addAnnotatedClasses(annotationDb, annotatedClassNames, Adaptables.class);
View Full Code Here

         db.setScanFieldAnnotations(false);
         db.setScanMethodAnnotations(false);
         db.setScanParameterAnnotations(false);
         try
         {
            db.scanArchives(urls);
            try
            {
               db.crossReferenceImplementedInterfaces();
               db.crossReferenceMetaAnnotations();
            }
View Full Code Here

         db.setScanFieldAnnotations(false);
         db.setScanMethodAnnotations(false);
         db.setScanParameterAnnotations(false);
         try
         {
            db.scanArchives(urls);
            try
            {
               db.crossReferenceImplementedInterfaces();
               db.crossReferenceMetaAnnotations();
            }
View Full Code Here

  }

  private Map<String, Set<String>> scanWebInfClasses(URL webInfClasses) {
    try {
      AnnotationDB db = createAnnotationDB();
      db.scanArchives(webInfClasses);
      return db.getAnnotationIndex();
    } catch (IOException e) {
      throw new ScannerException("Could not scan WEB-INF/classes", e);
    }
  }
View Full Code Here

  }

  private Map<String, Set<String>> scanWebInfClasses(URL webInfClasses) {
    try {
      AnnotationDB db = createAnnotationDB();
      db.scanArchives(webInfClasses);
      return db.getAnnotationIndex();
    } catch (IOException e) {
      throw new ScannerException("Could not scan WEB-INF/classes", e);
    }
  }
View Full Code Here

          }
          if (!file.startsWith("file:")) {
            file = "file:" + file;
          }

          db.scanArchives(new URL(file));
        } while (urls.hasMoreElements());
      }

      return db.getAnnotationIndex();
    } catch (IOException e) {
View Full Code Here

public class AnnotationTests {
    @Test
    public void findAnnotations() throws IOException {
        URL[] urls = ClasspathUrlFinder.findClassPaths(); // scan java.class.path
        AnnotationDB db = new AnnotationDB();
        db.scanArchives(urls);
        Set<String> entities = db.getAnnotationIndex().get(Entity.class.getName());
        for (String entity : entities) {
            System.out.println("entity=" + entity);
        }
    }
View Full Code Here

                for (URL url : urls) {
                    logger.fine(url.toString());
                }
            }
            AnnotationDB annotationDB = new AnnotationDB();
            annotationDB.scanArchives(urls);
            entities = annotationDB.getAnnotationIndex().get(Entity.class.getName());
            if (entities != null) {
                for (String entity : entities) {
                    initEntity(entity);
                }
View Full Code Here

              toAdd.add(url);
            }
          }
          finalUrls.addAll(toAdd);
      AnnotationDB db = new AnnotationDB();
      db.scanArchives(finalUrls.toArray(new URL[finalUrls.size()]));
      Set<String> entityClasses = db.getAnnotationIndex().get(
          javax.persistence.Entity.class.getName());
      for (String entityClass : entityClasses) {
        Class clazz = Class.forName(entityClass);
        if (UserDefinable.class.isAssignableFrom(clazz))
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.