View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.java;
5   
6   import java.io.Reader;
7   
8   import net.sourceforge.pmd.lang.ParserOptions;
9   import net.sourceforge.pmd.lang.java.ast.JavaParser;
10  import net.sourceforge.pmd.lang.java.ast.ParseException;
11  
12  /**
13   * Adapter for the JavaParser, using Java 1.6 grammar.
14   */
15  public class Java16Parser extends AbstractJavaParser {
16  
17      public Java16Parser(ParserOptions parserOptions) {
18  	super(parserOptions);
19      }
20  
21      @Override
22      protected JavaParser createJavaParser(Reader source) throws ParseException {
23  	JavaParser javaParser = super.createJavaParser(source);
24  	javaParser.setJdkVersion(6);
25  	return javaParser;
26      }
27  }