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.AntPathMatcher
Constructor and Description |
---|
PatternBasedPackageScanFilter() |
Modifier and Type | Method and Description |
---|---|
void |
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 |
matches(Class<?> candidateClass)
Tests if a given class matches the patterns in this filter.
|
public void addExcludePattern(String excludePattern)
public void addIncludePattern(String includePattern)
public void addIncludePatterns(Collection<String> includes)
public void addExcludePatterns(Collection<String> excludes)
public boolean matches(Class<?> candidateClass)
AntPathMatcher
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.
matches
in interface org.apache.camel.spi.PackageScanFilter
Apache Camel