Examples of SubTypesScanner


Examples of org.reflections.scanners.SubTypesScanner

    if (name.charAt(dot + 1) == '*') {
      List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
      classLoadersList.add(ClasspathHelper.contextClassLoader());
      classLoadersList.add(ClasspathHelper.staticClassLoader());
     
      Reflections reflections = new Reflections(new ConfigurationBuilder().setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
          .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[0]))).filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(name.substring(0, dot)))));
      Set<Class<?>> classes = reflections.getSubTypesOf(Object.class);
      for (Class<?> clazz : classes) {
        name = clazz.getName();
        dot = name.lastIndexOf('.');
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

                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),
                        new MethodParameterScanner())
                .setUrls(ClasspathHelper.forPackage(packName)));
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

        List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
        classLoadersList.add(ClasspathHelper.contextClassLoader());
        classLoadersList.add(ClasspathHelper.staticClassLoader());

        ConfigurationBuilder configuration = new ConfigurationBuilder()
                .setScanners(new SubTypesScanner(false), new ResourcesScanner())
                .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[classLoadersList.size()])))
                .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(inputPackage)));

        Reflections reflections = new Reflections(configuration);
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

        List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
        classLoadersList.add(ClasspathHelper.contextClassLoader());
        classLoadersList.add(ClasspathHelper.staticClassLoader());

        ConfigurationBuilder configuration = new ConfigurationBuilder()
                .setScanners(new SubTypesScanner(false), new ResourcesScanner())
                .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[classLoadersList.size()])))
                .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(inputPackage)));

        Reflections reflections = new Reflections(configuration);
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

      cfgBldr.addUrls(ClasspathHelper.forPackage(basePkg));
      filterBuilder.include(FilterBuilder.prefix(basePkg));
    }

    cfgBldr.filterInputsBy(filterBuilder).setScanners(
        new SubTypesScanner(), new TypeAnnotationsScanner());
    this.reflections = new Reflections(cfgBldr);
  }
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

                filterInputsBy(filter);
                setUrls(ClasspathHelper.getUrlsForPackagePrefix(prefix));
                if (scanners == null || scanners.length == 0) {
                    setScanners(
                            new TypeAnnotationsScanner().filterResultsBy(filter),
                            new SubTypesScanner().filterResultsBy(filter));
                } else {
                    setScanners(scanners);
                }
            }
        });
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

      throw new SAXException(String.format("Unabled to load tag \"%s\"", tagName));
    }
  }

  private void loadTags() throws SAXException {
    Reflections r = new Reflections("simpleserver", new SubTypesScanner());
    Set<Class<? extends XMLTag>> classes = r.getSubTypesOf(XMLTag.class);

    for (Class<? extends XMLTag> tag : classes) {
      if (Modifier.isAbstract(tag.getModifiers())) {
        continue;
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

      return "!";
    }
  }

  private <T extends Command> void loadCommands(Class<T> type, Map<String, T> commands, Map<Class, T> commandClasses) {
    Reflections r = new Reflections("simpleserver", new SubTypesScanner());
    Set<Class<? extends T>> types = r.getSubTypesOf(type);

    for (Class<? extends T> commandType : types) {
      if (Modifier.isAbstract(commandType.getModifiers())) {
        continue;
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

    return tags.get(tagName);
  }

  private void loadTags() throws SAXException {
    Reflections r = new Reflections("simpleserver", new SubTypesScanner());
    Set<Class<? extends TagConverter>> classes = r.getSubTypesOf(TagConverter.class);

    for (Class<? extends TagConverter> tag : classes) {
      if (Modifier.isAbstract(tag.getModifiers())) {
        continue;
View Full Code Here

Examples of org.reflections.scanners.SubTypesScanner

  private Map<Class<?>, ModelMetadata> scan(ClassLoader... classloaders) {
    Map<Class<?>, ModelMetadata> map = Maps.newHashMap();

    final Reflections reflections = new Reflections(new ConfigurationBuilder().setUrls(
        ClasspathHelper.forPackage("", classloaders)).setScanners(new SubTypesScanner(),
        new TypeAnnotationsScanner()).addClassLoaders(classloaders));

    Set<Class<?>> entities = reflections.getTypesAnnotatedWith(Entity.class);
    for (Class<?> entity : entities) {
      ModelMetadata metadata = getMetadata(entity);
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.