View Javadoc

    1   /***
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package net.sourceforge.pmd.cpd;
    5
    6   import net.sourceforge.pmd.SourceFileSelector;
    7
    8   import java.io.FilenameFilter;
    9   import java.util.Properties;
    10
    11  public class JavaLanguage implements Language {
    12
    13      private JavaTokenizer tokenizer;
    14
    15      private SourceFileSelector sourceFileSelector;
    16
    17      public JavaLanguage() {
    18          this(new Properties());
    19      }
    20
    21      public JavaLanguage(Properties properties) {
    22          tokenizer = new JavaTokenizer();
    23          tokenizer.setProperties(properties);
    24          sourceFileSelector = new SourceFileSelector();
    25      }
    26
    27      public Tokenizer getTokenizer() {
    28          return tokenizer;
    29      }
    30
    31      public FilenameFilter getFileFilter() {
    32          return new SourceFileOrDirectoryFilter(sourceFileSelector);
    33      }
    34  }