com.puppycrawl.tools.checkstyle.checks.coding

Class DeclarationOrderCheck

Implemented Interfaces:
Configurable, Contextualizable

public class DeclarationOrderCheck
extends Check

According to Code Conventions for the Java Programming Language , the parts of a class or interface declaration should appear in the following order
  • Class (static) variables. First the public class variables, then the protected, then package level (no access modifier), and then the private.
  • Instance variables. First the public class variables, then the protected, then package level (no access modifier), and then the private.
  • Constructors
  • Methods
  • An example of how to configure the check is:

     <module name="DeclarationOrder"/>
     

    Author:
    r_auckenthaler

    Method Summary

    int[]
    getDefaultTokens()
    void
    leaveToken(DetailAST aAST)
    void
    visitToken(DetailAST aAST)

    Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

    beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, 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, log, log, log, log, log, setSeverity

    Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

    configure, contextualize, finishLocalSetup, getConfiguration, setupChild

    Method Details

    getDefaultTokens

    public int[] getDefaultTokens()
    Overrides:
    getDefaultTokens in interface Check

    See Also:
    Check.getDefaultTokens()


    leaveToken

    public void leaveToken(DetailAST aAST)
    Overrides:
    leaveToken in interface Check

    See Also:
    Check.leaveToken(DetailAST)


    visitToken

    public void visitToken(DetailAST aAST)
    Overrides:
    visitToken in interface Check

    See Also:
    Check.visitToken(DetailAST)