de.kosi.utiltest
Class KosiDoclet

java.lang.Object
  |
  +--com.sun.javadoc.Doclet
        |
        +--de.kosi.utiltest.KosiDoclet

public class KosiDoclet
extends com.sun.javadoc.Doclet

Doclet that checks that there is information available for every package, class, interface and member. (modified, to log Warnings to a logfile)

Version:
$Revision: 1.4 $
Author:
Ernst de Haan (ernst@jollem.com)

Field Summary
static java.lang.String LOGFILE
          Datei in der die Warnungen Protokolliert werden.
 
Constructor Summary
KosiDoclet()
          Von dieser Klasse sollten keine Instanzen erzeugt werden, da sie nur statische Methoden enthält.
 
Method Summary
protected static void checkClasses(com.sun.javadoc.ClassDoc[] classes)
          Checks all aspects of the documentation of the specified classes.
protected static void checkClassImpl()
          Checks classes.
protected static void checkConstructor()
          Checks all aspects of the documentation of the constructor.
protected static void checkConstructorImpl()
          Checks Constructors.
protected static void checkConstructorReturnImpl()
          Empty Method.
protected static void checkExceptions()
          Checks the exceptions of a Method.
protected static void checkExceptionsImpl()
          Checks method exceptions.
protected static void checkExecutableMembers(com.sun.javadoc.ExecutableMemberDoc[] members)
          Checks all aspects of the documentation of the specified executable members.
protected static void checkFieldImpl()
          Checks fields.
protected static void checkFields(com.sun.javadoc.FieldDoc[] fields)
          Checks all aspects of the documentation of the specified fields.
protected static void checkMethod()
          Checks a Method.
protected static void checkMethodImpl()
          Checks methods.
protected static void checkMethodReturnImpl()
          Checks method return value.
protected static void checkPackageImpl()
          Checks a package.
protected static void checkPackages(com.sun.javadoc.PackageDoc[] packages)
          Checks all aspects of the documentation of the specified packages.
protected static void checkParameters()
          Checks the parameters of a Method.
protected static void checkParametersImpl()
          Checks method parameters.
protected static void checkReturn()
          Checks the return value of a Method.
protected static void foundCommentsForNonExistentException(java.lang.String name)
          Handler for the cognition that there are comments for a non-existing exception.
protected static void foundCommentsForNonExistentParameter(java.lang.String name)
          Handler for the cognition that there are comments for a non-existing parameter.
protected static void foundCommentsForNonExistentReturnValue(int count)
          Handler for the cognition that there are comments for a non-existing return value.
protected static boolean isEmptyString(java.lang.String s)
          Returns if a string is empty.
protected static void missingClassComments()
          Handler for the condition that a class has no associated comments.
protected static void missingCommentsForException(java.lang.String name)
          Handler for the cognition that there are no comments for a exception.
protected static void missingCommentsForReturnValue()
          Handler for the cognition that there is no comment for a return value.
protected static void missingConstructorComments()
          Hanlder for the conition that an executable member (constructor, class function or instance method) has no associated comments.
protected static void missingFieldComments()
          Handler for the cognition that there are no comments for a field.
protected static void missingMethodComments()
          Hanlder for the conition that an executable member (constructor, class function or instance method) has no associated comments.
protected static void missingPackageComments()
          Handler for the condition that a package has no associated comments.
protected static void missingParameterComments(java.lang.String name)
          Handler for the cognition that the parameter for an executable member (constructor, class function or instance method) has no associated comments.
protected static void multipleCommentsForParameter(java.lang.String name, int count)
          Handler for the cognition that there are multiple comments for a executable member-
protected static void multipleCommentsForReturnValue(int count)
          Handler for the cognition that there are multiple comments for a return value.
static boolean start(com.sun.javadoc.RootDoc rootDoc)
          Run this doclet for the specified packages or classes.
 
Methods inherited from class com.sun.javadoc.Doclet
optionLength, validOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGFILE

public static final java.lang.String LOGFILE
Datei in der die Warnungen Protokolliert werden.
Constructor Detail

KosiDoclet

public KosiDoclet()
Von dieser Klasse sollten keine Instanzen erzeugt werden, da sie nur statische Methoden enthält.
Method Detail

start

public static boolean start(com.sun.javadoc.RootDoc rootDoc)
Run this doclet for the specified packages or classes.
Parameters:
rootDoc - The information for this run of javadoc.
Returns:
On success, true, on failure: false.

checkPackages

protected static final void checkPackages(com.sun.javadoc.PackageDoc[] packages)
Checks all aspects of the documentation of the specified packages. This class function will perform the following steps for every package:

If the argument is null, then no packages or classes are checked.

At the end, both packageDoc and packageName are set to null.

Note: This method does not handle duplicate elements gracefully.

Parameters:
packages - The packages to be checked. There should be no null elements, and no duplicate elements.

checkClasses

protected static final void checkClasses(com.sun.javadoc.ClassDoc[] classes)
Checks all aspects of the documentation of the specified classes.
Parameters:
classes - Classes to be checked.

checkFields

protected static final void checkFields(com.sun.javadoc.FieldDoc[] fields)
Checks all aspects of the documentation of the specified fields.
Parameters:
fields - Fields to be checked.

checkExecutableMembers

protected static final void checkExecutableMembers(com.sun.javadoc.ExecutableMemberDoc[] members)
Checks all aspects of the documentation of the specified executable members.
Parameters:
members - executable members to be checked.

checkConstructor

protected static final void checkConstructor()
Checks all aspects of the documentation of the constructor.

checkMethod

protected static final void checkMethod()
Checks a Method.

checkParameters

protected static final void checkParameters()
Checks the parameters of a Method.

checkReturn

protected static final void checkReturn()
Checks the return value of a Method.

checkExceptions

protected static final void checkExceptions()
Checks the exceptions of a Method.

checkPackageImpl

protected static void checkPackageImpl()
Checks a package.

checkClassImpl

protected static final void checkClassImpl()
Checks classes.

checkFieldImpl

protected static void checkFieldImpl()
Checks fields.

checkConstructorImpl

protected static void checkConstructorImpl()
Checks Constructors.

checkMethodImpl

protected static void checkMethodImpl()
Checks methods.

checkParametersImpl

protected static void checkParametersImpl()
Checks method parameters.

checkMethodReturnImpl

protected static void checkMethodReturnImpl()
Checks method return value.

checkConstructorReturnImpl

protected static void checkConstructorReturnImpl()
Empty Method.

checkExceptionsImpl

protected static void checkExceptionsImpl()
Checks method exceptions.

missingPackageComments

protected static void missingPackageComments()
Handler for the condition that a package has no associated comments.

missingClassComments

protected static void missingClassComments()
Handler for the condition that a class has no associated comments.

missingMethodComments

protected static void missingMethodComments()
Hanlder for the conition that an executable member (constructor, class function or instance method) has no associated comments.

missingConstructorComments

protected static void missingConstructorComments()
Hanlder for the conition that an executable member (constructor, class function or instance method) has no associated comments.

missingParameterComments

protected static void missingParameterComments(java.lang.String name)
Handler for the cognition that the parameter for an executable member (constructor, class function or instance method) has no associated comments.
Parameters:
name - Name of the missing parameter.

multipleCommentsForParameter

protected static void multipleCommentsForParameter(java.lang.String name,
                                                   int count)
Handler for the cognition that there are multiple comments for a executable member-
Parameters:
name - Name of the missing parameter.
count - the number of the comments.

foundCommentsForNonExistentParameter

protected static void foundCommentsForNonExistentParameter(java.lang.String name)
Handler for the cognition that there are comments for a non-existing parameter.
Parameters:
name - Name of the parameter.

missingCommentsForReturnValue

protected static void missingCommentsForReturnValue()
Handler for the cognition that there is no comment for a return value.

multipleCommentsForReturnValue

protected static void multipleCommentsForReturnValue(int count)
Handler for the cognition that there are multiple comments for a return value.
Parameters:
count - number of the comments.

foundCommentsForNonExistentReturnValue

protected static void foundCommentsForNonExistentReturnValue(int count)
Handler for the cognition that there are comments for a non-existing return value.
Parameters:
count - number of the comments.

missingCommentsForException

protected static void missingCommentsForException(java.lang.String name)
Handler for the cognition that there are no comments for a exception.
Parameters:
name - Name of the Exception.

foundCommentsForNonExistentException

protected static void foundCommentsForNonExistentException(java.lang.String name)
Handler for the cognition that there are comments for a non-existing exception.
Parameters:
name - Name of the Exception.

missingFieldComments

protected static void missingFieldComments()
Handler for the cognition that there are no comments for a field.

isEmptyString

protected static final boolean isEmptyString(java.lang.String s)
Returns if a string is empty.
Parameters:
s - String to be tested.
Returns:
if the String is empty or null.