Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.checks.xpath
Class XPathCheck  view XPathCheck download XPathCheck.java

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.api.AutomaticBean
      extended bycom.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
          extended bycom.puppycrawl.tools.checkstyle.api.Check
              extended bycom.puppycrawl.tools.checkstyle.checks.xpath.XPathCheck
All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable, com.puppycrawl.tools.checkstyle.api.Contextualizable

public class XPathCheck
extends com.puppycrawl.tools.checkstyle.api.Check

Checks for an XPath in the root AST. Path elements are named according to token types. Attributes of an element are bean properties. Requires jaxen, http://jaxen.sourceforge.net and saxpath, http://sourceforge.net/projects/saxpath/. Idea shamelessly stolen from the equivalent PMD rule (pmd.sourceforge.net).


Field Summary
private  java.lang.String mMessage
          error message
private  XPath mXPath
          XPath for this check
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.Check
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
 
Constructor Summary
XPathCheck()
           
 
Method Summary
 void beginTree(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
          Called before the starting to process a tree.
 int[] getDefaultTokens()
          Returns the default token a check is interested in.
 void setMessage(java.lang.String aMessage)
          Sets the error message for this check.
 void setXPath(java.lang.String aXPath)
          Sets the XPath for this check.
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check
destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, setSeverity
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mXPath

private XPath mXPath
XPath for this check


mMessage

private java.lang.String mMessage
error message

Constructor Detail

XPathCheck

public XPathCheck()
Method Detail

getDefaultTokens

public int[] getDefaultTokens()
Description copied from class: com.puppycrawl.tools.checkstyle.api.Check
Returns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.


beginTree

public void beginTree(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
Description copied from class: com.puppycrawl.tools.checkstyle.api.Check
Called before the starting to process a tree. Ideal place to initialise information that is to be collected whilst processing a tree.


setMessage

public void setMessage(java.lang.String aMessage)
Sets the error message for this check.


setXPath

public void setXPath(java.lang.String aXPath)
              throws JaxenException
Sets the XPath for this check.