Package com.sun.jersey.spi.scanning

Examples of com.sun.jersey.spi.scanning.AnnotationScannerListener


      });

  public void scan(URLClassLoader classLoader) {
    Scanner scanner = buildScanner(classLoader);

    AnnotationScannerListener listener = new AnnotationScannerListener(ANNOTATIONS);
    scanner.scan(listener);

    for (Class<?> clazz : listener.getAnnotatedClasses()) {
      for (Class<? extends Annotation> annotation : ANNOTATIONS) {
        if (clazz.isAnnotationPresent(annotation)) {
          AnnotationDictionary annotationDictionary = getAnnotationDictionary(annotation);
          annotationDictionary.add(clazz);
        }
View Full Code Here


     * @param scanner the scanner.
     */
    public void init(final Scanner scanner) {
        this.scanner = scanner;

        final AnnotationScannerListener asl = new PathProviderScannerListener();
        scanner.scan(asl);

        getClasses().addAll(asl.getAnnotatedClasses());
       
        if (LOGGER.isLoggable(Level.INFO) && !getClasses().isEmpty()) {
            final Set<Class> rootResourceClasses = get(Path.class);
            if (rootResourceClasses.isEmpty()) {
                LOGGER.log(Level.INFO, "No root resource classes found.");
View Full Code Here

      Iterable<String> entityPackages) {
    checkNotNull(configuration);
   
    final List<String> entityClasses = Lists.newLinkedList();
    for (String entityPackage : checkNotNull(entityPackages)) {
      @SuppressWarnings("unchecked")
      final AnnotationScannerListener listener = new AnnotationScannerListener(Entity.class);
      final PackageNamesScanner scanner = new PackageNamesScanner(new String[] { entityPackage });
      logger.info("Scanning " + entityPackage + " for entity classes");
      scanner.scan(listener);
      for (Class<?> entityClass : listener.getAnnotatedClasses()) {
        configuration.addAnnotatedClass(entityClass);
        entityClasses.add(entityClass.getCanonicalName());
      }
    }
    Collections.sort(entityClasses);
View Full Code Here

     * using a scanner.
     *
     * @param scanner the scanner.
     */
    public void init(final Scanner scanner) {
        final AnnotationScannerListener asl = new PathProviderScannerListener();
        scanner.scan(asl);

        getClasses().addAll(asl.getAnnotatedClasses());
       
        if (LOGGER.isLoggable(Level.INFO) && !getClasses().isEmpty()) {
            final Set<Class> rootResourceClasses = get(Path.class);
            if (rootResourceClasses.isEmpty()) {
                LOGGER.log(Level.INFO, "No root resource classes found.");
View Full Code Here

TOP

Related Classes of com.sun.jersey.spi.scanning.AnnotationScannerListener

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.