Package com.cloudera.cdk.morphline.shaded.com.google.common.reflect

Examples of com.cloudera.cdk.morphline.shaded.com.google.common.reflect.ClassPath


   * of guava without issues.
   */
  <T> Collection<Class<T>> getTopLevelClasses(Iterable<String> importSpecs, Class<T> iface) {   
    HashMap<String,Class<T>> classes = new LinkedHashMap();
    for (ClassLoader loader : getClassLoaders()) {
      ClassPath classPath;
      try {
        classPath = ClassPath.from(loader);
      } catch (IOException e) {
        continue;
      }
      for (String importSpec : importSpecs) {
        Set<ClassInfo> classInfos = null;
        if (importSpec.endsWith(".**")) {
          String packageName = importSpec.substring(0, importSpec.length() - ".**".length());
          classInfos = classPath.getTopLevelClassesRecursive(packageName);
        } else if (importSpec.endsWith(".*")) {
          String packageName = importSpec.substring(0, importSpec.length() - ".*".length());
          classInfos = classPath.getTopLevelClasses(packageName);
        } else { // importSpec is assumed to be a fully qualified class name
          Class clazz;
          try {
            //clazz = Class.forName(importSpec, true, loader);
            clazz = loader.loadClass(importSpec);
View Full Code Here

TOP

Related Classes of com.cloudera.cdk.morphline.shaded.com.google.common.reflect.ClassPath

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.