View Javadoc

    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;
    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  }