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.7.
    15   *
    16   */
    17  public class TargetJDK1_7 implements TargetJDKVersion {
    18
    19      /**
    20       * @see net.sourceforge.pmd.TargetJDKVersion#createParser(InputStream)
    21       */
    22      public JavaParser createParser(InputStream 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 in) {
    32          JavaParser jp = new JavaParser(new JavaCharStream(in));
    33          jp.setJDK15();
    34          return jp;
    35      }
    36
    37      public String getVersionString() {
    38          return "1.7";
    39      }
    40
    41  }