Package org.reflections.util

Examples of org.reflections.util.ConfigurationBuilder


            }
        });
    }

    protected Reflections() {
        configuration = new ConfigurationBuilder();
        store = new Store();
    }
View Full Code Here


  }

  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) {
View Full Code Here

   
    Collection<URL> urls = ClasspathHelper.forPackage("play.utils.meta.convert", classloaders);
    if (log.isDebugEnabled())
      log.debug("urls : " + urls);

    Configuration configs = new ConfigurationBuilder().setUrls(
        urls).addClassLoaders(classloaders).setScanners(new SubTypesScanner(false));
   
    final Reflections reflections = new Reflections(configs);

    Map<Class<?>, Converter<?>> map = Maps.newHashMap();
View Full Code Here

    return getCrudController(keyClass, modelClass, crudControllers);
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  private <C extends CRUD> Map<Class<?>, ControllerProxy<?, ?>> scanRest(GlobalSettings global, Class<C> superType, ClassLoader... cls) {
    final Reflections reflections = new Reflections(new ConfigurationBuilder().setUrls(
        ClasspathHelper.forPackage("", cls)).setScanners(new SubTypesScanner(),
        new TypeAnnotationsScanner()).addClassLoaders(cls));

    Map<Class<?>, ControllerProxy<?, ?>> map = Maps.newHashMap();
    Set<Class<? extends C>> controllerClasses = reflections.getSubTypesOf(superType);
View Full Code Here

    return map;
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  private <C extends CRUD> Map<Class<?>, ControllerProxyCRUD<?, ?>> scanCrud(GlobalSettings global, Class<C> superType, ClassLoader... cls) {
    final Reflections reflections = new Reflections(new ConfigurationBuilder().setUrls(
        ClasspathHelper.forPackage("", cls)).setScanners(new SubTypesScanner(),
        new TypeAnnotationsScanner()).addClassLoaders(cls));

    Map<Class<?>, ControllerProxyCRUD<?, ?>> map = Maps.newHashMap();
    Set<Class<? extends C>> controllerClasses = reflections.getSubTypesOf(superType);
View Full Code Here

      try {
        loaders.add(Thread.currentThread().getContextClassLoader());
      } catch (Exception ex) {
        // ignore
      }
      Configuration config = new ConfigurationBuilder()
        .setUrls(ClasspathHelper.forManifest(ClasspathHelper.forJavaClassPath()))
        .setScanners(new TypeAnnotationsScanner(), new FieldAnnotationsScanner(), new SubTypesScanner(false))
        .filterInputsBy(FilterBuilder.parse(AnnotationReflector.DEFAULT_ANNOTATION_REFLECTOR_FILTER))
        .addClassLoaders(loaders)
        .useParallelExecutor();
View Full Code Here

    public Reflections(final Object... params) {
        this(ConfigurationBuilder.build(params));
    }

    protected Reflections() {
        configuration = new ConfigurationBuilder();
        store = new Store(configuration);
    }
View Full Code Here

    public static final FilterBuilder TestModelFilter = new FilterBuilder().include("org.reflections.TestModel\\$.*");
    static Reflections reflections;

    @BeforeClass
    public static void init() {
        reflections = new Reflections(new ConfigurationBuilder()
                .setUrls(asList(ClasspathHelper.forClass(TestModel.class)))
                .filterInputsBy(TestModelFilter)
                .setScanners(
                        new SubTypesScanner(false),
                        new TypeAnnotationsScanner(),
View Full Code Here

    }

    @Test
    public void testResourcesScanner() {
        Predicate<String> filter = new FilterBuilder().include(".*\\.xml").exclude(".*testModel-reflections\\.xml");
        Reflections reflections = new Reflections(new ConfigurationBuilder()
                .filterInputsBy(filter)
                .setScanners(new ResourcesScanner())
                .setUrls(asList(ClasspathHelper.forClass(TestModel.class))));

        Set<String> resolved = reflections.getResources(Pattern.compile(".*resource1-reflections\\.xml"));
 
View Full Code Here

    @BeforeClass
    public static void generateAndSave() {
        Predicate<String> filter = new FilterBuilder().include("org.reflections.TestModel\\$.*");

        Reflections reflections = new Reflections(new ConfigurationBuilder()
                .filterInputsBy(filter)
                .setScanners(new TypeElementsScanner().includeFields().publicOnly(false))
                .setUrls(asList(ClasspathHelper.forClass(TestModel.class))));

        //save
View Full Code Here

TOP

Related Classes of org.reflections.util.ConfigurationBuilder

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.