Class PackageFilter

java.lang.Object
org.ocpsoft.rewrite.annotation.scan.PackageFilter

public class PackageFilter extends Object

This class represents a package filter specified by the com.ocpsoft.pretty.SCAN_PACKAGES initialization parameter.

Author:
Christian Kaltepoth
  • Constructor Details

    • PackageFilter

      public PackageFilter(String config)
      Creates a new PackageFilter
      Parameters:
      config - Comma-separated list of packages (null safe)
  • Method Details

    • isAllowedPackage

      public boolean isAllowedPackage(String packageName)

      Checks whether the supplied packages matches the filter.

      The method returns true if one of the following checks succeed:

      • The supplied package is one of the packages specified in the filter condition.
      • The supplied package is a sub-package of one of the packages specified in the filter condition.
      Parameters:
      packageName - A package name
      Returns:
      true if the filter matches
    • getNumberOfBasePackages

      public int getNumberOfBasePackages()
      Returns the total number of base packages that this instance is holding.
      Returns:
      Number of base packages
    • toString

      public String toString()
      Overrides:
      toString in class Object