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 underlyingAntPathMatcher
to filter scanned files according to include and exclude patterns.- See Also:
AntPathMatcher
-
-
Constructor Summary
Constructors Constructor Description PatternBasedPackageScanFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
addExcludePattern
public void addExcludePattern(String excludePattern)
add and exclude pattern to the filter. Classes matching this pattern will not match the filter
-
addIncludePattern
public void addIncludePattern(String includePattern)
add and include pattern to the filter. Classes must match one of supplied include patterns to match the filter
-
addIncludePatterns
public void addIncludePatterns(Collection<String> includes)
-
addExcludePatterns
public void addExcludePatterns(Collection<String> excludes)
-
matches
public boolean matches(Class<?> candidateClass)
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
-
-