Examples of AnnotationDB


Examples of org.scannotation.AnnotationDB

                logger.fine("classpath urls:");
                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

Examples of org.scannotation.AnnotationDB

        for (URL url : urls) {
          if (!url.toString().endsWith(".jar"))
            location += url.toString() + ", ";
        }
        _log.info("Scanning files at " + location);
        db = new AnnotationDB();
        db.scanArchives(urls);
    }
View Full Code Here

Examples of org.scannotation.AnnotationDB

            } else {
              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))
          udfClasses.put(clazz, clazz.getSimpleName());
View Full Code Here

Examples of org.scannotation.AnnotationDB

          LOGGER.debug("URL full path: [" + url.toString() +"]");
            LOGGER.debug("Final URL is : [" + url.getPath() +
                "] with protocol: [" + url.getProtocol() +
                "] with file: [" + url.getFile() + "]");
          }
          AnnotationDB db = new AnnotationDB();
          db.scanArchives(finalUrls.toArray(new URL[finalUrls.size()]));
          Set<String> entityClasses = db.getAnnotationIndex().get(javax.persistence.Entity.class.getName());
            // Create the SessionFactory
          Configuration ac =  new Configuration();
          Properties properties = XMLPersistenceUtil.getProperties(persistenceFile, persistenceUnitName);
          ac.setProperties(properties);
          if (StringUtil.isEmpty(jndiName)) {
View Full Code Here

Examples of org.scannotation.AnnotationDB

    for(URL url : urls) {
      System.out.println(url.toString());
        System.out.println("URL is : [" + url.getPath() + "] with protocol: [" + url.getProtocol() + "]");
        System.out.println(url.getFile());
      }
    AnnotationDB db = new AnnotationDB();
      db.scanArchives(urls);
      Set<String> entityClasses = db.getAnnotationIndex().get(javax.persistence.Entity.class.getName());
      System.out.println(entityClasses);
  }
View Full Code Here

Examples of org.scannotation.AnnotationDB

  return results;
  }

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

Examples of org.scannotation.AnnotationDB

  }
  }

  private Map<String, Set<String>> scanBasePackages(List<String> basePackages, ClasspathResolver resolver) {
  try {
    AnnotationDB db = createAnnotationDB();

    for (String basePackage : basePackages) {
    scanPackage(basePackage, db, resolver);
    }

    return db.getAnnotationIndex();
  } catch (IOException e) {
    throw new ScannerException("Could not scan base packages", e);
  }
  }
View Full Code Here

Examples of org.scannotation.AnnotationDB

  private <T> Set<T> nullToEmpty(Set<T> set) {
  return firstNonNull(set, Collections.<T>emptySet());
  }

  private AnnotationDB createAnnotationDB() {
  AnnotationDB db = new AnnotationDB();
  db.setScanClassAnnotations(true);
  db.setScanFieldAnnotations(false);
  db.setScanMethodAnnotations(false);
  db.setScanParameterAnnotations(false);
  return db;
  }
View Full Code Here

Examples of org.scannotation.AnnotationDB

    return results;
  }

  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

Examples of org.scannotation.AnnotationDB

    }
  }

  private Map<String, Set<String>> scanBasePackages(List<String> basePackages) {
    try {
      AnnotationDB db = createAnnotationDB();

      for (String basePackage : basePackages) {
        scanPackage(basePackage, db);
      }

      return db.getAnnotationIndex();
    } catch (IOException e) {
      throw new ScannerException("Could not scan base packages", e);
    }
  }
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.