com.puppycrawl.tools.checkstyle.checks.coding

Class DeclarationOrderCheck

public class DeclarationOrderCheck extends Check

Checks that the parts of a class or interface declaration appear in the order suggested by the Code Conventions for the Java Programming Language.

  1. Class (static) variables. First the public class variables, then the protected, then package level (no access modifier), and then the private.
  2. Instance variables. First the public class variables, then the protected, then package level (no access modifier), and then the private.
  3. Constructors
  4. Methods

An example of how to configure the check is:

 <module name="DeclarationOrder"/>
 

Author: r_auckenthaler

Method Summary
int[]getDefaultTokens()
{@inheritDoc}
voidleaveToken(DetailAST aAST)
{@inheritDoc}
voidvisitToken(DetailAST aAST)
{@inheritDoc}

Method Detail

getDefaultTokens

public int[] getDefaultTokens()
{@inheritDoc}

leaveToken

public void leaveToken(DetailAST aAST)
{@inheritDoc}

visitToken

public void visitToken(DetailAST aAST)
{@inheritDoc}