Codota Logo
SubTypesScanner.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.reflections.scanners.SubTypesScanner
constructor

Best Java code snippets using org.reflections.scanners.SubTypesScanner.<init> (Showing top 20 results out of 918)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: ronmamo/reflections

public ConfigurationBuilder() {
  scanners = Sets.<Scanner>newHashSet(new TypeAnnotationsScanner(), new SubTypesScanner());
  urls = Sets.newHashSet();
}
origin: stackoverflow.com

 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("org.your.package"))));
origin: org.reflections/reflections

public ConfigurationBuilder() {
  scanners = Sets.<Scanner>newHashSet(new TypeAnnotationsScanner(), new SubTypesScanner());
  urls = Sets.newHashSet();
}
origin: ninjaframework/ninja

/**
 * Searches for Methods that have either a Path Annotation or a HTTP-Method Annotation
 */
@SuppressWarnings("unchecked")
private Set<Method> findControllerMethods() {
  Set<Method> methods = Sets.newLinkedHashSet();
  methods.addAll(reflections.getMethodsAnnotatedWith(Path.class));
  Reflections annotationReflections = new Reflections("", new TypeAnnotationsScanner(), new SubTypesScanner());
  for (Class<?> httpMethod : annotationReflections.getTypesAnnotatedWith(HttpMethod.class)) {
    if (httpMethod.isAnnotation()) {
      methods.addAll(reflections.getMethodsAnnotatedWith((Class<? extends Annotation>) httpMethod));
    }
  }
  return methods;
}
origin: thinkaurelius/titan

  .setScanners(new TypeAnnotationsScanner(), new SubTypesScanner());
Reflections reflections = new Reflections(rc);
origin: JanusGraph/janusgraph

  .setScanners(new TypeAnnotationsScanner(), new SubTypesScanner());
Reflections reflections = new Reflections(rc);
origin: querydsl/querydsl

/**
 * Return the classes from the given package and subpackages using the supplied classloader
 *
 * @param classLoader classloader to be used
 * @param pkg package to scan
 * @return set of found classes
 * @throws IOException
 */
public static Set<Class<?>> scanPackage(ClassLoader classLoader, String pkg) throws IOException {
  Reflections reflections = new Reflections(new ConfigurationBuilder()
      .addUrls(ClasspathHelper.forPackage(pkg, classLoader))
      .addClassLoader(classLoader)
      .setScanners(new SubTypesScanner(false)));
  Set<Class<?>> classes = new HashSet<Class<?>>();
  for (String typeNames : reflections.getStore().get(SubTypesScanner.class.getSimpleName()).values()) {
    Class<?> clazz = safeClassForName(classLoader, typeNames);
    if (clazz != null) {
      classes.add(clazz);
    }
  }
  return classes;
}
origin: swagger-api/swagger-core

config.setScanners(new ResourcesScanner(), new TypeAnnotationsScanner(), new SubTypesScanner());
origin: swagger-api/swagger-core

config.setScanners(new ResourcesScanner(), new TypeAnnotationsScanner(), new SubTypesScanner());
final Reflections reflections;
reflections = new Reflections(config);
origin: MorphiaOrg/morphia

conf.addScanners(new SubTypesScanner());
origin: igniterealtime/Smack

  testPackages = config.testPackages.toArray(new String[config.testPackages.size()]);
Reflections reflections = new Reflections(testPackages, new SubTypesScanner(),
        new TypeAnnotationsScanner(), new MethodAnnotationsScanner(), new MethodParameterScanner());
Set<Class<? extends AbstractSmackIntegrationTest>> inttestClasses = reflections.getSubTypesOf(AbstractSmackIntegrationTest.class);
origin: knightliao/disconf

.setScanners(new SubTypesScanner().filterResultsBy(filter),
    new TypeAnnotationsScanner()
        .filterResultsBy(filter),
origin: stackoverflow.com

Reflections reflections = new Reflections("my.pkg", new SubTypesScanner(false));
origin: KylinOLAP/Kylin

private void init() {
  providers = Maps.newConcurrentMap();
  // use reflection to load providers
  final Set<Class<? extends IRealizationProvider>> realizationProviders = new Reflections("org.apache.kylin", new SubTypesScanner()).getSubTypesOf(IRealizationProvider.class);
  List<Throwable> es = Lists.newArrayList();
  for (Class<? extends IRealizationProvider> cls : realizationProviders) {
    try {
      IRealizationProvider p = (IRealizationProvider) cls.getMethod("getInstance", KylinConfig.class).invoke(null, config);
      providers.put(p.getRealizationType(), p);
    } catch (Exception | NoClassDefFoundError e) {
      es.add(e);
    }
    if (es.size() > 0) {
      for (Throwable exceptionOrError : es) {
        logger.error("Create new store instance failed ", exceptionOrError);
      }
      throw new IllegalArgumentException("Failed to find metadata store by url: " + config.getMetadataUrl());
    }
  }
  logger.info("RealizationRegistry is " + providers);
}
origin: mulesoft/mule

 private Set<Class<?>> getExtensionTypes(Collection<URL> urls) {
  try {
   return new Reflections(new ConfigurationBuilder()
     .setUrls(urls)
     .setScanners(new SubTypesScanner(), new TypeAnnotationsScanner()))
       .getTypesAnnotatedWith(Extension.class);
  } catch (Exception e) {
   return emptySet();
  }
 }
}
origin: apache/cloudstack

public static Set<Class<?>> getClassesWithAnnotation(Class<? extends Annotation> annotation, String[] packageNames) {
  Reflections reflections;
  Set<Class<?>> classes = new HashSet<Class<?>>();
  ConfigurationBuilder builder=new ConfigurationBuilder();
  for (String packageName : packageNames) {
     builder.addUrls(ClasspathHelper.forPackage(packageName));
  }
  builder.setScanners(new SubTypesScanner(),new TypeAnnotationsScanner());
  reflections = new Reflections(builder);
  classes.addAll(reflections.getTypesAnnotatedWith(annotation));
  return classes;
}
origin: structurizr/java

    .setUrls(urls)
    .filterInputsBy(new FilterBuilder().includePackage(packagesToScan.toArray(new String[packagesToScan.size()])))
    .setScanners(new SubTypesScanner(false), allTypesScanner)
);
origin: timolson/cointrader

public static Reflections getCommandReflections() {
  if( commandReflections == null ) {
    List<String> paths = ConfigUtil.getPathProperty("command.path");
    Set<URL> urls = new HashSet<>();
    for( String path : paths )
      urls.addAll(ClasspathHelper.forPackage(path));
    commandReflections = new Reflections(urls, new SubTypesScanner());
  }
  return commandReflections;
}
origin: alibaba/COLA

/**
 * the classes and the packages to be scanned.
 *
 * @param packages packages.
 */
public ClassPathScanHandler(String... packages) {
  this.reflections = new Reflections(new ConfigurationBuilder().
      forPackages(packages).
      addScanners(new TypeAnnotationsScanner(), new SubTypesScanner())//.addUrls(urlList)
  );
}
origin: pengrad/java-telegram-bot-api

@Before
public void setClasses() {
  String modelPackage = Animation.class.getPackage().getName();
  Reflections reflections = new Reflections(modelPackage, new SubTypesScanner(false));
  Set<Class<?>> allSubPackageClasses = reflections.getSubTypesOf(Object.class);
  classes = new HashSet<Class>();
  for (Class clazz : allSubPackageClasses) {
    if (clazz.getPackage().getName().equals(modelPackage)) {
      classes.add(clazz);
    }
  }
}
org.reflections.scannersSubTypesScanner<init>

Javadoc

created new SubTypesScanner. will exclude direct Object subtypes

Popular methods of SubTypesScanner

  • filterResultsBy
  • acceptResult
  • getMetadataAdapter
  • getStore

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now