Package org.reflections

Examples of org.reflections.reflections$TestModel$Usage$C1$fields


      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

            LOG.warn("Did not find key '" + PACKAGE_PREFIX_KEY + "' and so entities will not be eagerly registered in the Isis metamodel");
            return;
        }
       
        for (String packagePrefix : Splitter.on(",").split(packagePrefixes)) {
            Reflections reflections = new Reflections(packagePrefix);
           
            Set<Class<?>> entityTypes =
                    reflections.getTypesAnnotatedWith(PersistenceCapable.class);
           
            if(noEntitiesIn(entityTypes)) {
                LOG.error("Could not locate any PersistenceCapable entities in " + packagePrefix);
            }
            for (Class<?> entityType : entityTypes) {
View Full Code Here

    /**
     * Generates a new instance of ReflectionsTypeScanner.
     */
    public ReflectionsTypeScanner() {
        reflections = new Reflections(ClasspathHelper.forJavaClassPath());
    }
View Full Code Here

        Predicate<String> filter = new FilterBuilder().includePackage(
                Constants.DISCONF_PACK_NAME).includePackage(packName);

        //
        Reflections reflections = new Reflections(new ConfigurationBuilder()
                .filterInputsBy(filter)
                .setScanners(new SubTypesScanner().filterResultsBy(filter),
                        new TypeAnnotationsScanner().filterResultsBy(filter),
                        new FieldAnnotationsScanner().filterResultsBy(filter),
                        new MethodAnnotationsScanner().filterResultsBy(filter),
View Full Code Here

        ScanStaticModel scanModel = new ScanStaticModel();

        //
        // 扫描对象
        //
        Reflections reflections = getReflection(packName);
        scanModel.setReflections(reflections);

        //
        // 获取DisconfFile class
        //
        Set<Class<?>> classdata = reflections
                .getTypesAnnotatedWith(DisconfFile.class);
        scanModel.setDisconfFileClassSet(classdata);

        //
        // 获取DisconfFileItem method
        //
        Set<Method> af1 = reflections
                .getMethodsAnnotatedWith(DisconfFileItem.class);
        scanModel.setDisconfFileItemMethodSet(af1);

        //
        // 获取DisconfItem method
        //
        af1 = reflections.getMethodsAnnotatedWith(DisconfItem.class);
        scanModel.setDisconfItemMethodSet(af1);

        //
        // 获取DisconfActiveBackupService
        //
        classdata = reflections
                .getTypesAnnotatedWith(DisconfActiveBackupService.class);
        scanModel.setDisconfActiveBackupServiceClassSet(classdata);

        //
        // 获取DisconfUpdateService
        //
        classdata = reflections
                .getTypesAnnotatedWith(DisconfUpdateService.class);
        scanModel.setDisconfUpdateService(classdata);

        return scanModel;
    }
View Full Code Here

    public static final String PROP_EXTRA_CLASSES = "jaxb.additionalContextClasses";

    public static Class<?>[] findExtraClasses(Class<?> type) {
        String prefix = type.getPackage().getName();
        Reflections reflections = new Reflections(prefix);
        Set<Class<?>> extraClasses = reflections.getTypesAnnotatedWith(XmlRootElement.class);
        return extraClasses.toArray(new Class<?>[extraClasses.size()]);
    }
View Full Code Here

    this.catalog = new HashMap<String, Class<?>>();
    loadSubclasses(PLUGTEST_2_SUPERCLASS);
  }
 
  public void loadSubclasses(Class<?> superclass) {
    Reflections reflections = new Reflections("ch.ethz.inf.vs.californium");
    for (Class<?> clazz:reflections.getSubTypesOf(superclass))
      loadClass(clazz);
  }
View Full Code Here

            }

            // 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<Method> annotated = reflections.getMethodsAnnotatedWith(Documentation.class);

                    Iterator<Method> it = annotated.iterator();

                    while (it.hasNext()) {
                        Method m = it.next();
View Full Code Here

     * default implementation or for some reason the reflection approach is unable to properly get all of the
     * classes required.  It should be clear that a custom implementation of this method is required if there are
     * failures in the GroovyEnvironmentSuite.
     */
    public default Set<Class> getImplementations() {
        final Reflections reflections = new Reflections(this.getClass().getPackage().getName());

        final Set<Class> implementations = new HashSet<>();
        reflections.getSubTypesOf(Graph.class).forEach(implementations::add);
        reflections.getSubTypesOf(Property.class).forEach(implementations::add);
        reflections.getSubTypesOf(Element.class).forEach(implementations::add);
        reflections.getSubTypesOf(Traversal.class).forEach(implementations::add);
        reflections.getSubTypesOf(Traverser.class).forEach(implementations::add);
        reflections.getSubTypesOf(GraphTraversal.class).forEach(implementations::add);
        reflections.getSubTypesOf(DefaultGraphTraversal.class).forEach(implementations::add);

        return implementations.stream()
                .filter(c -> !c.isInterface())
                .collect(Collectors.toSet());
    }
View Full Code Here

TOP

Related Classes of org.reflections.reflections$TestModel$Usage$C1$fields

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.