Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.errai.reflections.util
Class ConfigurationBuilder

    java.lang.Object
      org.jboss.errai.reflections.util.ConfigurationBuilder

All Implemented Interfaces:
  Configuration

    public class ConfigurationBuilder

extends java.lang.Object
implements Configuration

a fluent builder for `Configuration`, to be used for constructing a `Reflections` instance

usage:

          new Reflections(
              new ConfigurationBuilder()
                  .filterInputsBy(new FilterBuilder().include("your project's common package prefix here..."))
                  .setUrls(ClasspathHelper.forClassLoader())
                  .setScanners(new SubTypesScanner(), new TypeAnnotationsScanner().filterResultsBy(myClassAnnotationsFilter)));

`executorService` is used optionally used for parallel scanning. if value is null then scanning is done in a simple for loop

defaults: accept all for `inputsFilter`, `executorService` is null, `serializer` is `XmlSerializer`

Constructor Summary
`ConfigurationBuilder()`

Method Summary
`boolean` | `acceptsInput(java.lang.String inputFqn)` the fully qualified name filter used to filter types to be scanned
`ConfigurationBuilder` | `addUrls(java.util.Collection<java.net.URL>... urlss)` add urls to be scanned
`ConfigurationBuilder` | `addUrls(java.util.Collection<java.net.URL> urls)` add urls to be scanned
`ConfigurationBuilder` | `addUrls(java.net.URL... urls)` add urls to be scanned
`ConfigurationBuilder` | `filterInputsBy(com.google.common.base.Predicate<java.lang.String> inputsFilter)` sets the input filter for all resources to be scanned
`java.util.concurrent.ExecutorService` | `getExecutorService()` executor service used to scan files if null, scanning is done in a simple for loop
`MetadataAdapter` | `getMetadataAdapter()` the metadata adapter used to fetch metadata from classes
`java.util.Set<Scanner>` | `getScanners()` the scanner instances used for scanning different metadata
`Serializer` | `getSerializer()` the default serializer to use when saving Reflection
`java.util.Set<java.net.URL>` | `getUrls()` the urls to be scanned
`ConfigurationBuilder` | `setExecutorService(java.util.concurrent.ExecutorService executorService)` sets the executor service used for scanning.
`ConfigurationBuilder` | `setMetadataAdapter(MetadataAdapter metadataAdapter)` sets the metadata adapter used to fetch metadata from classes
`ConfigurationBuilder` | `setScanners(Scanner... scanners)` set the scanners instances for scanning different metadata
`ConfigurationBuilder` | `setSerializer(Serializer serializer)` sets the serializer used when issuing `Reflections.save(java.lang.String)`
`ConfigurationBuilder` | `setUrls(java.util.Collection<java.net.URL>... urlss)` set the urls to be scanned
`ConfigurationBuilder` | `setUrls(java.util.Collection<java.net.URL> urls)` set the urls to be scanned
`ConfigurationBuilder` | `setUrls(java.net.URL... urls)` set the urls to be scanned
`ConfigurationBuilder` | `useParallelExecutor()` sets the executor service used for scanning to ThreadPoolExecutor with core size as `Runtime.availableProcessors()`
`ConfigurationBuilder` | `useParallelExecutor(int availableProcessors)` sets the executor service used for scanning to ThreadPoolExecutor with core size as the given availableProcessors parameter

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ConfigurationBuilder

    public ConfigurationBuilder()

Method Detail

### getScanners

    public java.util.Set<Scanner> getScanners()

  Description copied from interface: `Configuration`
  the scanner instances used for scanning different metadata

  Specified by:
    `getScanners` in interface `Configuration`

### setScanners

    public ConfigurationBuilder setScanners(Scanner... scanners)

  set the scanners instances for scanning different metadata

### getUrls

    public java.util.Set<java.net.URL> getUrls()

  Description copied from interface: `Configuration`
  the urls to be scanned

  Specified by:
    `getUrls` in interface `Configuration`

### setUrls

    public ConfigurationBuilder setUrls(java.util.Collection<java.net.URL> urls)

  set the urls to be scanned

  use `ClasspathHelper` convenient methods to get the relevant urls

### setUrls

    public ConfigurationBuilder setUrls(java.net.URL... urls)

  set the urls to be scanned

  use `ClasspathHelper` convenient methods to get the relevant urls

### setUrls

    public ConfigurationBuilder setUrls(java.util.Collection<java.net.URL>... urlss)

  set the urls to be scanned

  use `ClasspathHelper` convenient methods to get the relevant urls

### addUrls

    public ConfigurationBuilder addUrls(java.util.Collection<java.net.URL> urls)

  add urls to be scanned

  use `ClasspathHelper` convenient methods to get the relevant urls

### addUrls

    public ConfigurationBuilder addUrls(java.net.URL... urls)

  add urls to be scanned

  use `ClasspathHelper` convenient methods to get the relevant urls

### addUrls

    public ConfigurationBuilder addUrls(java.util.Collection<java.net.URL>... urlss)

  add urls to be scanned

  use `ClasspathHelper` convenient methods to get the relevant urls

### getMetadataAdapter

    public MetadataAdapter getMetadataAdapter()

  Description copied from interface: `Configuration`
  the metadata adapter used to fetch metadata from classes

  Specified by:
    `getMetadataAdapter` in interface `Configuration`

### setMetadataAdapter

    public ConfigurationBuilder setMetadataAdapter(MetadataAdapter metadataAdapter)

  sets the metadata adapter used to fetch metadata from classes

### acceptsInput

    public boolean acceptsInput(java.lang.String inputFqn)

  Description copied from interface: `Configuration`
  the fully qualified name filter used to filter types to be scanned

  Specified by:
    `acceptsInput` in interface `Configuration`

### filterInputsBy

    public ConfigurationBuilder filterInputsBy(com.google.common.base.Predicate<java.lang.String> inputsFilter)

  sets the input filter for all resources to be scanned

  supply a `Predicate` or use the `FilterBuilder`

### getExecutorService

    public java.util.concurrent.ExecutorService getExecutorService()

  Description copied from interface: `Configuration`
  executor service used to scan files if null, scanning is done in a simple for loop

  Specified by:
    `getExecutorService` in interface `Configuration`

### setExecutorService

    public ConfigurationBuilder setExecutorService(java.util.concurrent.ExecutorService executorService)

  sets the executor service used for scanning.

### useParallelExecutor

    public ConfigurationBuilder useParallelExecutor()

  sets the executor service used for scanning to ThreadPoolExecutor with core size as `Runtime.availableProcessors()`

  default is ThreadPoolExecutor with a single core

### useParallelExecutor

    public ConfigurationBuilder useParallelExecutor(int availableProcessors)

  sets the executor service used for scanning to ThreadPoolExecutor with core size as the given availableProcessors parameter

  default is ThreadPoolExecutor with a single core

### getSerializer

    public Serializer getSerializer()

  Description copied from interface: `Configuration`
  the default serializer to use when saving Reflection

  Specified by:
    `getSerializer` in interface `Configuration`

### setSerializer

    public ConfigurationBuilder setSerializer(Serializer serializer)

  sets the serializer used when issuing `Reflections.save(java.lang.String)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011. All Rights Reserved.