Examples of ClassScanner


Examples of io.hawt.util.introspect.support.ClassScanner

* Dumps all the classes on the classpath using hte ClassScanner
*/
public class Main {

    public static void main(String[] args) {
        ClassScanner scanner = ClassScanner.newInstance();
        SortedMap<String, Class<?>> answer = scanner.getAllClassesMap();

        for (Class<?> aClass : answer.values()) {
            System.out.println(aClass.getName());
        }
    }
View Full Code Here

Examples of jodd.io.findfile.ClassScanner

  /**
   * Loads props from classpath.
   */
  public static void loadFromClasspath(final Props p, final String... patterns) {
    final ClassScanner scanner = new ClassScanner() {
      @Override
      protected void onEntry(EntryData entryData) throws IOException {
        String encoding = JoddCore.encoding;
        if (StringUtil.endsWithIgnoreCase(entryData.getName(), ".properties")) {
          encoding = StringPool.ISO_8859_1;
        }
        p.load(entryData.openInputStream(), encoding);
      }
    };
    scanner.setIncludeResources(true);
    scanner.setIgnoreException(true);
    scanner.setIncludedEntries(patterns);
    scanner.scanDefaultClasspath();
  }
View Full Code Here

Examples of jodd.io.findfile.ClassScanner

  /**
   * Loads properties from classpath file(s). Properties are specified using wildcards.
   */
  public static Properties loadFromClasspath(final Properties p, String... rootTemplate) {
    ClassScanner scanner = new ClassScanner() {
      @Override
      protected void onEntry(EntryData entryData) throws IOException {
        p.load(entryData.openInputStream());
      }
    };
    scanner.setIncludeResources(true);
    scanner.setIgnoreException(true);
    scanner.setIncludedEntries(rootTemplate);
    scanner.scanDefaultClasspath();
    return p;
  }
View Full Code Here

Examples of jodd.io.findfile.ClassScanner

  /**
   * Loads props from classpath.
   */
  public static void loadFromClasspath(final Props p, final String... patterns) {
    final ClassScanner scanner = new ClassScanner() {
      @Override
      protected void onEntry(EntryData entryData) throws IOException {
        String encoding = JoddCore.encoding;
        if (StringUtil.endsWithIgnoreCase(entryData.getName(), ".properties")) {
          encoding = StringPool.ISO_8859_1;
        }
        p.load(entryData.openInputStream(), encoding);
      }
    };
    scanner.setIncludeResources(true);
    scanner.setIgnoreException(true);
    scanner.setExcludeAllEntries(true);
    scanner.setIncludedEntries(patterns);
    scanner.scanDefaultClasspath();
  }
View Full Code Here

Examples of jodd.io.findfile.ClassScanner

  /**
   * Loads properties from classpath file(s). Properties are specified using wildcards.
   */
  public static Properties loadFromClasspath(final Properties p, String... rootTemplate) {
    ClassScanner scanner = new ClassScanner() {
      @Override
      protected void onEntry(EntryData entryData) throws IOException {
        p.load(entryData.openInputStream());
      }
    };
    scanner.setIncludeResources(true);
    scanner.setIgnoreException(true);
    scanner.setExcludeAllEntries(true);
    scanner.setIncludedEntries(rootTemplate);
    scanner.scanDefaultClasspath();
    return p;
  }
View Full Code Here

Examples of jodd.io.findfile.ClassScanner

    File containerFile = FileUtil.toContainerFile(url);

    final ValueHolder<String> jqueryName = new ValueHolder<String>();

    ClassScanner classScanner = new ClassScanner() {
      @Override
      protected void onEntry(EntryData entryData) throws Exception {
        if (entryData.getName().endsWith("jquery.js")) {
          jqueryName.setValue(entryData.getName());
        }
      }
    };

    classScanner.setIncludeResources(true);
    classScanner.scan(containerFile);

    assertNotNull(url);

    assertEquals("/META-INF/resources/webjars/jquery/2.1.1/jquery.js", jqueryName.getValue());
  }
View Full Code Here

Examples of org.apache.felix.scrplugin.helper.ClassScanner

        // create the annotation processor manager
        final AnnotationProcessor aProcessor = new AnnotationProcessorManager(this.logger,
                        this.project.getClassLoader());

        // create the class scanner - and start scanning
        this.scanner = new ClassScanner(logger, iLog, project, aProcessor);
        final List<ClassDescription> scannedDescriptions = scanner.scanSources();

        // create the result to hold the list of processed source files
        final Result result = new Result();
        final List<ComponentContainer> processedContainers = new ArrayList<ComponentContainer>();
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.