de.smartics.maven.exceptions.util
Class FilterUtils

Package class diagram package FilterUtils
java.lang.Object
  extended by de.smartics.maven.exceptions.util.FilterUtils

public final class FilterUtils
     
     
extends Object

Provides utilities for filtering on Doc elements.


Method Summary
static boolean isImplementing(com.sun.javadoc.ClassDoc classDoc, Class<?> type)
          Checks if the given class is implementing the given interface type.
static boolean isInterfaceDeclared(com.sun.javadoc.ClassDoc classDoc, Class<?> type)
          Checks if the given class is implementing the given interface type directly.
static boolean isValidJavaIdentifier(String token)
          Checks if the given token is a valid Java identifier.
static boolean isValidJavaPackageDirPath(String path)
          Checks that the path is a valid directory path for packages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isImplementing

public static boolean isImplementing(com.sun.javadoc.ClassDoc classDoc,
                                     Class<?> type)
Checks if the given class is implementing the given interface type. It runs up the inheritance path to the root to see if any parent class implements the specified interface.

Parameters:
classDoc - the class that is tested on implementing the interface of the given type.
type - the type of the interface to test.
Returns:
true if the class implements the given type, false otherwise.

isInterfaceDeclared

public static boolean isInterfaceDeclared(com.sun.javadoc.ClassDoc classDoc,
                                          Class<?> type)
                                   throws NullPointerException
Checks if the given class is implementing the given interface type directly.

If the classDoc value is null, false is returned. This is to provide the same interface as in isImplementing(ClassDoc, Class).

Parameters:
classDoc - the class that is tested on implementing the interface of the given type.
type - the type of the interface to test.
Returns:
true if the class declares the given type in its implements clause, false otherwise.
Throws:
NullPointerException - if the given interface type is null.

isValidJavaIdentifier

public static boolean isValidJavaIdentifier(String token)
Checks if the given token is a valid Java identifier.

Parameters:
token - the token to check.
Returns:
true if the token is a valid Java identifier, false otherwise.

isValidJavaPackageDirPath

public static boolean isValidJavaPackageDirPath(String path)
Checks that the path is a valid directory path for packages.

Parameters:
path - the path to check if it is valid.
Returns:
true if every directory name in the path is a valid Java package name, false otherwise.


Copyright © 2007-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.