View Javadoc

    1   package net.sourceforge.pmd.lang.ecmascript.rule;
    2
    3   import net.sourceforge.pmd.lang.Language;
    4   import net.sourceforge.pmd.lang.ParserOptions;
    5   import net.sourceforge.pmd.lang.ecmascript.EcmascriptParserOptions;
    6   import net.sourceforge.pmd.lang.rule.XPathRule;
    7   import net.sourceforge.pmd.lang.rule.properties.BooleanProperty;
    8   import net.sourceforge.pmd.lang.rule.properties.EnumeratedProperty;
    9
    10  public class EcmascriptXPathRule extends XPathRule {
    11
    12      private static final BooleanProperty RECORDING_COMMENTS_DESCRIPTOR = EcmascriptParserOptions.RECORDING_COMMENTS_DESCRIPTOR;
    13      private static final BooleanProperty RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR = EcmascriptParserOptions.RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR;
    14      private static final EnumeratedProperty<EcmascriptParserOptions.Version> RHINO_LANGUAGE_VERSION = EcmascriptParserOptions.RHINO_LANGUAGE_VERSION;
    15
    16      public EcmascriptXPathRule() {
    17  	super.setLanguage(Language.ECMASCRIPT);
    18  	definePropertyDescriptor(RECORDING_COMMENTS_DESCRIPTOR);
    19  	definePropertyDescriptor(RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR);
    20  	definePropertyDescriptor(RHINO_LANGUAGE_VERSION);
    21      }
    22
    23      @Override
    24      public ParserOptions getParserOptions() {
    25  	return new EcmascriptParserOptions(this);
    26      }
    27  }