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 java.io.FilenameFilter;
7   import java.util.Properties;
8   
9   import net.sourceforge.pmd.util.filter.Filters;
10  
11  public abstract class AbstractLanguage implements Language {
12  	private final Tokenizer tokenizer;
13  	private final FilenameFilter fileFilter;
14  
15  	public AbstractLanguage(Tokenizer tokenizer, String... extensions) {
16  		this.tokenizer = tokenizer;
17  		fileFilter = Filters.toFilenameFilter(Filters.getFileExtensionOrDirectoryFilter(extensions));
18  	}
19  
20  	public FilenameFilter getFileFilter() {
21  		return fileFilter;
22  	}
23  
24  	public Tokenizer getTokenizer() {
25  		return tokenizer;
26  	}
27  
28  	public void setProperties(Properties properties) {
29  	    // needs to be implemented by subclasses.
30  	}
31  }