Package org.reflections

Examples of org.reflections.reflections$TestModel$I3$annotations


            SortedMap<String, SortedSet<String>> positionedServices) {
        initIfRequired();

        for (final String packagePrefix : Iterables.transform(Splitter.on(",").split(packagePrefixes), trim())) {
            Vfs.setDefaultURLTypes(ClassDiscoveryServiceUsingReflections.getUrlTypes());
            Reflections reflections = new Reflections(packagePrefix);

            final Iterable<Class<?>> classes = Iterables.filter(
                    reflections.getTypesAnnotatedWith(DomainService.class), instantiatable());
            for (final Class<?> cls : classes) {

                final DomainService domainService = cls.getAnnotation(DomainService.class);
                final String order = domainService.menuOrder();
                final String serviceName = cls.getName();
View Full Code Here


    @Override
    public <T> Set<Class<? extends T>> findSubTypesOfClasses(Class<T> type) {
        Vfs.setDefaultURLTypes(getUrlTypes());

        final Reflections reflections = new Reflections(
                ClasspathHelper.forClassLoader(Thread.currentThread().getContextClassLoader()),
                ClasspathHelper.forClass(Object.class),
                new SubTypesScanner(false)
        );
        return reflections.getSubTypesOf(type);
    }
View Full Code Here

    @Override
    public <T> Set<Class<? extends T>> findSubTypesOfClasses(Class<T> type, String packagePrefix) {
        Vfs.setDefaultURLTypes(getUrlTypes());

        final Reflections reflections = new Reflections(
                ClasspathHelper.forClassLoader(Thread.currentThread().getContextClassLoader()),
                ClasspathHelper.forClass(Object.class),
                ClasspathHelper.forPackage(packagePrefix),
                new SubTypesScanner(false)
        );
        return reflections.getSubTypesOf(type);
    }
View Full Code Here

      cp.importPackage("org.zkoss.cdi.util");
     
      CtClass mainclas = cp.makeClass("org.zkoss.zkplus.cdi.ZKComponentProducerMethods");
      final List<URL> l = getUrlsForCurrentClasspath();
     
      Reflections reflections = new Reflections(
          new ConfigurationBuilder().setUrls(l)
          .setScanners(new FieldAnnotationsScanner()));
     
      Set<Field> fields = reflections.getFieldsAnnotatedWith(ComponentId.class);
      for (Iterator iterator2 = fields.iterator(); iterator2
          .hasNext();) {
        Field field = (Field) iterator2.next();
        CtClass cls = cp.get(field.getType().getName());
        String pckgName = cls.getPackageName();
View Full Code Here

    }

    // Gets all classes with some annotation from a package
    public static Set<Class<?>> getClassesWithAnnotation(Class<? extends Annotation> annotation,
                                                         String[] packageNames) {
        Reflections reflections;
        Set<Class<?>> classes = new HashSet<Class<?>>();
        for(String packageName: packageNames) {
            reflections = new Reflections(packageName);
            classes.addAll(reflections.getTypesAnnotatedWith(annotation));
        }
        return classes;
    }
View Full Code Here

    return map;
  }

  private static Reflections getReflections(){
    if(REFLECTIONS == null){
      REFLECTIONS = new Reflections(new ConfigurationBuilder().setUrls(getMarkedPaths()).setScanners(subTypeScanner, annotationsScanner, resourcesScanner));
    }
    return REFLECTIONS;
  }
View Full Code Here

      }else{
        urlSet.addAll(getClasspathUrlsByManifest());
        //above procedure doesn't ensure to obtain 'WEB-INF/classes'
        urlSet.add(ClasspathHelper.getUrlForServletContextClasses(sce.getServletContext()));
      }
      Reflections reflections = new Reflections(
          new ConfigurationBuilder().setUrls(urlSet)
          .setScanners(new FieldAnnotationsScanner()));
     
      Set<Field> fields = reflections.getFieldsAnnotatedWith(Autowired.class);
      int methodCounter = 0;
      for (Iterator<Field> iterator2 = fields.iterator(); iterator2.hasNext();) {
        Field mField = (Field) iterator2.next();
        CtClass cls = cp.get(mField.getType().getName());
        String pckgName = cls.getPackageName();
View Full Code Here

            jarURLs.add(jar.toURI().toURL());
        }

        // Scan classes and all jars
        final List<String> candidates = new ArrayList<String>();
        new Reflections(new ConfigurationBuilder().
                addUrls(jarURLs).setScanners(new AbstractScanner() {
            @Override
            public void scan(Object cls) {
                if ((cls instanceof ClassFile)) {
                    ClassFile classFile = (ClassFile) cls;
View Full Code Here

      this.addModuleMethods(modulePrefix, documentation.methods);

      // Check if there are complements via annotations
      if (d.getPackagesToScan() != null) {
        for (String pack : d.getPackagesToScan()) {
          Reflections reflections = new Reflections(
              new ConfigurationBuilder()
                  .setUrls(ClasspathHelper.forPackage(pack))
                  .setScanners(new MethodAnnotationsScanner()));

          Set<java.lang.reflect.Method> annotated = reflections
              .getMethodsAnnotatedWith(ar.com.jmfsg.documentation.annotation.Documentation.class);

          Iterator<java.lang.reflect.Method> it = annotated
              .iterator();
View Full Code Here

            jarURLs.add(jar.toURI().toURL());
        }

        final List<String> injectableClassNames = new ArrayList<String>();
        // Scan classes only
        new Reflections(new ConfigurationBuilder().
                addUrls(classesDirectory.toURI().toURL()).setScanners(new AbstractScanner() {
            @Override
            public void scan(Object cls) {
                if ((cls instanceof ClassFile) && isInjectable((ClassFile) cls, getLog())) {
                    injectableClassNames.add(((ClassFile) cls).getName());
View Full Code Here

TOP

Related Classes of org.reflections.reflections$TestModel$I3$annotations

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.