KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > cpd > PHPLanguage


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.File JavaDoc;
7 import java.io.FilenameFilter JavaDoc;
8
9 public class PHPLanguage implements Language {
10     
11     public static class PHPFileOrDirectoryFilter implements FilenameFilter JavaDoc {
12         public boolean accept(File JavaDoc dir, String JavaDoc filename) {
13             return filename.endsWith("php") || filename.endsWith("class") || (new File JavaDoc(dir.getAbsolutePath() + fileSeparator + filename).isDirectory());
14         }
15     }
16
17     public Tokenizer getTokenizer() {
18         return new PHPTokenizer();
19     }
20
21     public FilenameFilter JavaDoc getFileFilter() {
22         return new PHPFileOrDirectoryFilter();
23     }
24 }
25
Popular Tags