View Javadoc

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