Package org.apache.camel.core.xml
Class PatternBasedPackageScanFilter
java.lang.Object
org.apache.camel.core.xml.PatternBasedPackageScanFilter
- All Implemented Interfaces:
org.apache.camel.spi.PackageScanFilter
public class PatternBasedPackageScanFilter
extends Object
implements org.apache.camel.spi.PackageScanFilter
PatternBasedPackageScanFilter
uses an underlying AntPathMatcher
to filter scanned files according to
include and exclude patterns.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExcludePattern
(String excludePattern) add and exclude pattern to the filter.void
addExcludePatterns
(Collection<String> excludes) void
addIncludePattern
(String includePattern) add and include pattern to the filter.void
addIncludePatterns
(Collection<String> includes) boolean
Tests if a given class matches the patterns in this filter.
-
Constructor Details
-
PatternBasedPackageScanFilter
public PatternBasedPackageScanFilter()
-
-
Method Details
-
addExcludePattern
add and exclude pattern to the filter. Classes matching this pattern will not match the filter -
addIncludePattern
add and include pattern to the filter. Classes must match one of supplied include patterns to match the filter -
addIncludePatterns
-
addExcludePatterns
-
matches
Tests if a given class matches the patterns in this filter. Patterns are specified byAntPathMatcher
if no include or exclude patterns are set then all classes match.
If the filter contains only include filters, then the candidate class must match one of the include patterns to match the filter and return true.
If the filter contains only exclude filters, then the filter will return true unless the candidate class matches an exclude pattern.
if this contains both include and exclude filters, then the above rules apply with excludes taking precedence over includes i.e. an include pattern of java.util.* and an exclude pattern of java.util.jar.* will include a file only if it is in the util pkg and not in the util.jar package.
- Specified by:
matches
in interfaceorg.apache.camel.spi.PackageScanFilter
- Returns:
- true if candidate class matches according to the above rules
-