01: /*
02: * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03: */
04: package net.sourceforge.pmd;
05:
06: import net.sourceforge.pmd.ast.JavaCharStream;
07: import net.sourceforge.pmd.ast.JavaParser;
08:
09: import java.io.InputStream;
10: import java.io.Reader;
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 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 in) {
33: JavaParser jp = new JavaParser(new JavaCharStream(in));
34: jp.setJDK15();
35: return jp;
36: }
37:
38: public String getVersionString() {
39: return "1.5";
40: }
41:
42: }
|