KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > TargetJDK1_5


1 /*
2  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3  */

4 package net.sourceforge.pmd;
5
6 import net.sourceforge.pmd.ast.JavaCharStream;
7 import net.sourceforge.pmd.ast.JavaParser;
8
9 import java.io.InputStream JavaDoc;
10 import java.io.Reader JavaDoc;
11
12 /**
13  * This is an implementation of {@link net.sourceforge.pmd.TargetJDKVersion} for
14  * JDK 1.5.
15  *
16  * @author Tom Copeland
17  */

18 public class TargetJDK1_5 implements TargetJDKVersion {
19
20     /**
21      * @see net.sourceforge.pmd.TargetJDKVersion#createParser(InputStream)
22      */

23     public JavaParser createParser(InputStream JavaDoc in) {
24         JavaParser jp = new JavaParser(new JavaCharStream(in));
25         jp.setJDK15();
26         return jp;
27     }
28
29     /**
30      * @see net.sourceforge.pmd.TargetJDKVersion#createParser(Reader)
31      */

32     public JavaParser createParser(Reader JavaDoc in) {
33         JavaParser jp = new JavaParser(new JavaCharStream(in));
34         jp.setJDK15();
35         return jp;
36     }
37
38     public String JavaDoc getVersionString() {
39         return "1.5";
40     }
41
42 }
43
Popular Tags