KickJava   Java API By Example, From Geeks To Geeks.

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


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.6.
15  *
16  */

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

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

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