com.twitter.common.checkstyle
Class CheckStyleUtils

java.lang.Object
  extended by com.twitter.common.checkstyle.CheckStyleUtils

public final class CheckStyleUtils
extends Object

Utilities needed by custom checkstyle rules.


Method Summary
static String getMessageBundle(Class<? extends com.puppycrawl.tools.checkstyle.api.Check> parentBuiltInCheckClass)
          Returns the message bundle to use for a custom rule.
static boolean isOverrideMethod(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
          Checks to see if a method has the "@Override" annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessageBundle

public static String getMessageBundle(Class<? extends com.puppycrawl.tools.checkstyle.api.Check> parentBuiltInCheckClass)
Returns the message bundle to use for a custom rule. All built-in rules in checkstyle have a message bundle in the same package as that rule. This method returns the path to that bundle.

Parameters:
parentBuiltInCheckClass - The class of the built-in checkstyle rule that the custom rule ultimately derives from.
Returns:
Path to message bundle.

isOverrideMethod

public static boolean isOverrideMethod(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
Checks to see if a method has the "@Override" annotation.

Parameters:
aAST - The AST to check.
Returns:
Whether the AST represents a method that has the annotation.