Class ScanScope
java.lang.Object
dxt.scanpath.v1.ScanScope
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
ConstructorsConstructorDescriptionCreates a new scan scope with no classpath or libpath entries, and no package or type name filters. -
Method Summary
Modifier and TypeMethodDescriptionaddClassPath(String path) Adds an entry to the list of classpaths that should be scanned by the classpath browser for lookup of specific Java types.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.Creates a new scanning scope using the data contained within this scope.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.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.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.Excludes the system classpath from the scan scope.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.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.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.
-
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
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
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
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
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
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
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
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
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
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
Creates a new scanning scope using the data contained within this scope.- Returns:
- the new scan scope
-