View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.xml.rule;
5   
6   import net.sourceforge.pmd.lang.Language;
7   import net.sourceforge.pmd.lang.ParserOptions;
8   import net.sourceforge.pmd.lang.rule.XPathRule;
9   import net.sourceforge.pmd.lang.rule.properties.BooleanProperty;
10  import net.sourceforge.pmd.lang.xml.XmlParserOptions;
11  
12  public class XmlXPathRule extends XPathRule {
13  
14      public static final BooleanProperty COALESCING_DESCRIPTOR = XmlParserOptions.COALESCING_DESCRIPTOR;
15      public static final BooleanProperty EXPAND_ENTITY_REFERENCES_DESCRIPTOR = XmlParserOptions.EXPAND_ENTITY_REFERENCES_DESCRIPTOR;
16      public static final BooleanProperty IGNORING_COMMENTS_DESCRIPTOR = XmlParserOptions.IGNORING_COMMENTS_DESCRIPTOR;
17      public static final BooleanProperty IGNORING_ELEMENT_CONTENT_WHITESPACE_DESCRIPTOR = XmlParserOptions.IGNORING_ELEMENT_CONTENT_WHITESPACE_DESCRIPTOR;
18      public static final BooleanProperty NAMESPACE_AWARE_DESCRIPTOR = XmlParserOptions.NAMESPACE_AWARE_DESCRIPTOR;
19      public static final BooleanProperty VALIDATING_DESCRIPTOR = XmlParserOptions.VALIDATING_DESCRIPTOR;
20      public static final BooleanProperty XINCLUDE_AWARE_DESCRIPTOR = XmlParserOptions.XINCLUDE_AWARE_DESCRIPTOR;
21  
22      public XmlXPathRule() {
23  	super.setLanguage(Language.XML);
24  	definePropertyDescriptor(COALESCING_DESCRIPTOR);
25  	definePropertyDescriptor(EXPAND_ENTITY_REFERENCES_DESCRIPTOR);
26  	definePropertyDescriptor(IGNORING_COMMENTS_DESCRIPTOR);
27  	definePropertyDescriptor(IGNORING_ELEMENT_CONTENT_WHITESPACE_DESCRIPTOR);
28  	definePropertyDescriptor(NAMESPACE_AWARE_DESCRIPTOR);
29  	definePropertyDescriptor(VALIDATING_DESCRIPTOR);
30  	definePropertyDescriptor(XINCLUDE_AWARE_DESCRIPTOR);
31      }
32  
33      @Override
34      public ParserOptions getParserOptions() {
35  	return new XmlParserOptions(this);
36      }
37  }