Class ScanScope

java.lang.Object
dxt.scanpath.v1.ScanScope

public class ScanScope extends Object
This class is used to specify the classpath entries and library files to be scanned for specific Java types. It also defines the name patterns to be used to filter out and arrive at the final list of Java types to be used by the classpath browser for lookup operations.
Author:
indroneel
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new scan scope with no classpath or libpath entries, and no package or type name filters.
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds an entry to the list of classpaths that should be scanned by the classpath browser for lookup of specific Java types.
    Adds an entry to the list of libpaths that should be scanned by the classpath browser for lookup of specific Java types.
    Creates a new scanning scope using the data contained within this scope.
    Adds an entry to the list of type names to narrow down the set of Java types for lookup operations by the classpath browser.
    Adds an entry to the list of exclusion patterns to narrow down the set of Java types for lookup operations by the classpath browser.
    Adds an entry to the list of package names to narrow down the set of Java types for lookup operations by the classpath browser.
    Excludes the system classpath from the scan scope.
    Adds an entry to the list of type names to narrow down the set of Java types for lookup operations by the classpath browser.
    Adds an entry to the list of inclusion patterns to narrow down the set of Java types for lookup operations by the classpath browser.
    Adds an entry to the list of package names to narrow down the set of Java types for lookup operations by the classpath browser.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ScanScope

      public ScanScope()
      Creates a new scan scope with no classpath or libpath entries, and no package or type name filters. By default, the system classpath is included in the scan scope.
  • Method Details

    • addClassPath

      public ScanScope addClassPath(String path)
      Adds an entry to the list of classpaths that should be scanned by the classpath browser for lookup of specific Java types. A classpath denotes an absolute or relative path to a folder, or a ZIP/JAR archive containing a set of Java class files.
      Parameters:
      path - a classpath entry
      Returns:
      this object for fluent style invocation of methods.
    • addLibPath

      public ScanScope addLibPath(String path)
      Adds an entry to the list of libpaths that should be scanned by the classpath browser for lookup of specific Java types. A libpath is a folder on the local file system that contains a set of ZIP and JAR files, each of which should be treated as a classpath entry.
      Parameters:
      path - a libpath entry
      Returns:
      this object for fluent style invocation of methods.
    • excludeSystemClassPath

      public ScanScope excludeSystemClassPath()
      Excludes the system classpath from the scan scope. By default, the system classpath is included in the scan scope. This method can be used to exclude it if desired.
      Returns:
      this object for fluent style invocation of methods.
    • includePackage

      public ScanScope includePackage(String name)
      Adds an entry to the list of package names to narrow down the set of Java types for lookup operations by the classpath browser. Use of wildcard or any other form of pattern-matching expressions are not allowed. All Java types under this packages and sub-packages are included in the lookup scope.
      Parameters:
      name - a Java package name for inclusion.
      Returns:
      this object for fluent style invocation of methods.
    • excludePackage

      public ScanScope excludePackage(String name)
      Adds an entry to the list of package names to narrow down the set of Java types for lookup operations by the classpath browser. Use of wildcard or any other form of pattern-matching expressions are not allowed. All Java types under this packages and sub-packages are excluded from the lookup scope.
      Parameters:
      name - a Java package name for exclusion.
      Returns:
      this object for fluent style invocation of methods.
    • includeClassesByPattern

      public ScanScope includeClassesByPattern(String pattern)
      Adds an entry to the list of inclusion patterns to narrow down the set of Java types for lookup operations by the classpath browser. These patterns follow the semantics of Java regular expressions. Each fully qualified type name on the classpaths and libpaths is matched against these patterns for inclusion in the lookup scope.
      Parameters:
      pattern - a regular expression that can match a Java type name.
      Returns:
      this object for fluent style invocation of methods.
    • excludeClassesByPattern

      public ScanScope excludeClassesByPattern(String pattern)
      Adds an entry to the list of exclusion patterns to narrow down the set of Java types for lookup operations by the classpath browser. These patterns follow the semantics of Java regular expressions. Each fully qualified type name on the classpaths and libpaths is matched against these patterns for exclusion from the lookup scope.
      Parameters:
      pattern - a regular expression that can match a Java type name.
      Returns:
      this object for fluent style invocation of methods.
    • includeClass

      public ScanScope includeClass(String name)
      Adds an entry to the list of type names to narrow down the set of Java types for lookup operations by the classpath browser. Use of wildcard or any other form of pattern-matching expressions are not allowed.
      Parameters:
      name - a fully qualified type name for inclusion in the lookup scope.
      Returns:
      this object for fluent style invocation of methods.
    • excludeClass

      public ScanScope excludeClass(String name)
      Adds an entry to the list of type names to narrow down the set of Java types for lookup operations by the classpath browser. Use of wildcard or any other form of pattern-matching expressions are not allowed.
      Parameters:
      name - a fully qualified type name for exclusion from the lookup scope.
      Returns:
      this object for fluent style invocation of methods.
    • duplicate

      public ScanScope duplicate()
      Creates a new scanning scope using the data contained within this scope.
      Returns:
      the new scan scope