Package org.junithelper.core.meta.extractor

Examples of org.junithelper.core.meta.extractor.ClassMetaExtractor


  }

  protected static List<File> findTargets(Configuration config, String dirOrFile) throws Exception {
    dirOrFile = dirOrFile.replaceAll("\\\\", "/");
    List<File> dest = new ArrayList<File>();
    ClassMetaExtractor extractor = new ClassMetaExtractor(config);
    if (dirOrFile.matches(".+\\.java$")) {
      File file = new File(dirOrFile);
      String encoding = UniversalDetectorUtil.getDetectedEncoding(file);
      ClassMeta classMeta = extractor.extract(IOUtil.readAsString(new FileInputStream(file), encoding));
      if (!classMeta.isAbstract) {
        dest.add(file);
      }
    } else {
      List<File> javaFiles = new ArrayList<File>();
      FileSearcher fileSearcher = new CommonsIOFileSearcher();
      javaFiles = fileSearcher.searchFilesRecursivelyByName(dirOrFile, RegExp.FileExtension.JavaFile);
      for (File file : javaFiles) {
        String encoding = UniversalDetectorUtil.getDetectedEncoding(file);
        ClassMeta classMeta = extractor.extract(IOUtil.readAsString(
            new FileInputStream(file), encoding));
        if (!classMeta.name.matches(".*Test$") && !classMeta.isAbstract) {
          dest.add(file);
        }
      }
View Full Code Here


  private ClassMetaExtractor classMetaExtractor;
  private MethodMetaExtractor methodMetaExtractor;
  private ConstructorMetaExtractor constructorMetaExtractor;

  public DefaultSourceCodeParser(Configulation config) {
    classMetaExtractor = new ClassMetaExtractor(config);
    methodMetaExtractor = new MethodMetaExtractor(config);
    constructorMetaExtractor = new ConstructorMetaExtractor(config);
  }
View Full Code Here

  }

  protected static List<File> findTargets(Configuration config, String dirOrFile) throws Exception {
    dirOrFile = dirOrFile.replaceAll("\\\\", "/");
    List<File> dest = new ArrayList<File>();
    ClassMetaExtractor extractor = new ClassMetaExtractor(config);
    if (dirOrFile.matches(".+\\.java$")) {
      File file = new File(dirOrFile);
      String encoding = UniversalDetectorUtil.getDetectedEncoding(file);
      ClassMeta classMeta = extractor.extract(IOUtil.readAsString(new FileInputStream(file), encoding));
      if (!classMeta.isAbstract) {
        dest.add(file);
      }
    } else {
      List<File> javaFiles = new ArrayList<File>();
      FileSearcher fileSearcher = new CommonsIOFileSearcher();
      javaFiles = fileSearcher.searchFilesRecursivelyByName(dirOrFile, RegExp.FileExtension.JavaFile);
      for (File file : javaFiles) {
        String encoding = UniversalDetectorUtil.getDetectedEncoding(file);
        ClassMeta classMeta = extractor.extract(IOUtil.readAsString(new FileInputStream(file), encoding));
        if (!classMeta.name.matches(".*Test$") && !classMeta.isAbstract) {
          dest.add(file);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.junithelper.core.meta.extractor.ClassMetaExtractor

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.