org.openbp.common.classloader
Class PackageList

java.lang.Object
  extended by org.openbp.common.classloader.PackageList

public class PackageList
extends java.lang.Object

This class maintains a list of packages and methods allowing to check whether a given class is within the packages in the list.

Author:
Falk Hartmann

Constructor Summary
PackageList()
          Default constructor.
 
Method Summary
 void addPackage(java.lang.String packageName)
          This method adds a package name to this list.
 boolean containsClass(java.lang.String className)
          This method checks whether the class with the given name is in a package that is contained in this package list.
 boolean containsPackage(java.lang.String packageName)
          This method checks, whether the package with the given name is contained in this package list.
 void printDebug(java.lang.String prefix, XClassLoaderBase cl)
          Prints debug output to the given class loader's logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageList

public PackageList()
Default constructor.

Method Detail

addPackage

public void addPackage(java.lang.String packageName)
This method adds a package name to this list. If the package name ends with an asterisk, it is considered as containing all its subpackages.

Parameters:
packageName - The name of the package to be added

printDebug

public void printDebug(java.lang.String prefix,
                       XClassLoaderBase cl)
Prints debug output to the given class loader's logger.

Parameters:
prefix - Prefix to prepend to the log output
cl - Class loader

containsPackage

public boolean containsPackage(java.lang.String packageName)
This method checks, whether the package with the given name is contained in this package list.

Parameters:
packageName - The package name to check for
Returns:
true, if the package is contained in this list

containsClass

public boolean containsClass(java.lang.String className)
This method checks whether the class with the given name is in a package that is contained in this package list. Package-less classes are always considered as not contained.

Parameters:
className - The name of the class to check for
Returns:
false, if the class is package-less or in a package not contained in this package list


Copyright © 2011. All Rights Reserved.