kieker.checkstyle
Class CSUtility

java.lang.Object
  extended by kieker.checkstyle.CSUtility

public final class CSUtility
extends java.lang.Object

This is a simple utility class providing some methods which can be useful for other checkstyle checks as well.

Since:
1.7

Method Summary
static java.util.Collection<com.puppycrawl.tools.checkstyle.api.DetailAST> getMethodsFromClass(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
          This method extracts all method definitions from the given class (or interface).
static boolean isAbstract(com.puppycrawl.tools.checkstyle.api.DetailAST clazz)
          Checks whether the given class is marked as abstract or not.
static boolean isPrivate(com.puppycrawl.tools.checkstyle.api.DetailAST clazz)
          Checks whether the given class is marked as private or not.
static boolean parentIsInterface(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
          Checks whether the "parent" (the containing element) of the method is an interface or not.
static boolean sinceTagAvailable(com.puppycrawl.tools.checkstyle.api.Check check, com.puppycrawl.tools.checkstyle.api.DetailAST ast)
          This method checks whether the given component has a javadoc comment with a valid since tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sinceTagAvailable

public static boolean sinceTagAvailable(com.puppycrawl.tools.checkstyle.api.Check check,
                                        com.puppycrawl.tools.checkstyle.api.DetailAST ast)
This method checks whether the given component has a javadoc comment with a valid since tag.

Parameters:
check - The current check.
ast - The component to check for the tag.
Returns:
true if and only if there is a since tag in the javadoc comment of the given component.

getMethodsFromClass

public static java.util.Collection<com.puppycrawl.tools.checkstyle.api.DetailAST> getMethodsFromClass(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
This method extracts all method definitions from the given class (or interface).

Parameters:
ast - The class (or interface).
Returns:
A collection of available methods.

parentIsInterface

public static boolean parentIsInterface(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
Checks whether the "parent" (the containing element) of the method is an interface or not.

Parameters:
ast - The method to check.
Returns:
true if and only if the method is contained in an interface.

isPrivate

public static boolean isPrivate(com.puppycrawl.tools.checkstyle.api.DetailAST clazz)
Checks whether the given class is marked as private or not.

Parameters:
clazz - The class to check.
Returns:
true if and only if the class contains a private modifier.

isAbstract

public static boolean isAbstract(com.puppycrawl.tools.checkstyle.api.DetailAST clazz)
Checks whether the given class is marked as abstract or not.

Parameters:
clazz - The class to check.
Returns:
true if and only if the class contains an abstract modifier.