Package org.apache.rat.document.impl
Class TraceableDocumentNameMatcher
java.lang.Object
org.apache.rat.document.impl.TraceableDocumentNameMatcher
- All Implemented Interfaces:
DocumentNameMatcher
A PatternMatcher that will emit trace messages during execution if the environment variable is set.
Also provides a printable name for general logging.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The environment variable to set to enable tracing for the PatternMatcher executionstatic final TraceableDocumentNameMatcher
A TraceableDocumentNameMatcher that always returnsfalse
The supplier for the namestatic final TraceableDocumentNameMatcher
A TraceableDocumentNameMatcher that always returnstrue
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TraceableDocumentNameMatcher
(Supplier<String> name, DocumentNameMatcher delegate) Creates a traceable pattern matcher with the specified name. -
Method Summary
Modifier and TypeMethodDescriptionstatic TraceableDocumentNameMatcher
and
(TraceableDocumentNameMatcher... matchers) Performs a logical "AND" across the collection of matchers.static TraceableDocumentNameMatcher
from
(FileFilter fileFilter) static TraceableDocumentNameMatcher
make
(Supplier<String> name, DocumentNameMatcher delegate) Creates a TraceableDocumentNameMatcher from a PathMatcher.boolean
matches
(DocumentName documentName) static TraceableDocumentNameMatcher
not
(TraceableDocumentNameMatcher nameMatcher) Performs a logical "not" on a nameMatcher.static TraceableDocumentNameMatcher
or
(Collection<TraceableDocumentNameMatcher> matchers) Performs a logical "OR" across the collection of matchers.static TraceableDocumentNameMatcher
or
(TraceableDocumentNameMatcher... matchers) Performs a logical "OR" across the collection of matchers.toString()
-
Field Details
-
ENV_VAR
The environment variable to set to enable tracing for the PatternMatcher execution -
name
The supplier for the name -
TRUE
A TraceableDocumentNameMatcher that always returnstrue
-
FALSE
A TraceableDocumentNameMatcher that always returnsfalse
-
-
Constructor Details
-
TraceableDocumentNameMatcher
Creates a traceable pattern matcher with the specified name.- Parameters:
name
- the name of the pattern matcher.delegate
- the delegate that actually does the work.
-
-
Method Details
-
make
public static TraceableDocumentNameMatcher make(Supplier<String> name, DocumentNameMatcher delegate) Creates a TraceableDocumentNameMatcher from a PathMatcher. If thedelegate
is already a TraceableDocumentNameMatcher it will be returned unmodified.- Parameters:
name
- the name of the traceable path matcher.delegate
- the PathMatcher that will actually do the work.- Returns:
- the new TraceableDocumentNameMatcher
-
from
-
not
Performs a logical "not" on a nameMatcher.- Parameters:
nameMatcher
- the matcher to negate.- Returns:
- a PathMatcher that is the negation of the argument.
-
or
Performs a logical "OR" across the collection of matchers.- Parameters:
matchers
- the matchers to check.- Returns:
- a matcher that returns TRUE if any of the enclosed matchers returns true.
-
or
Performs a logical "OR" across the collection of matchers.- Parameters:
matchers
- the matchers to check.- Returns:
- a matcher that returns TRUE if any of the enclosed matchers returns true.
-
and
Performs a logical "AND" across the collection of matchers.- Parameters:
matchers
- the matchers to check.- Returns:
- a matcher that returns TRUE if all the enclosed matchers return true.
-
toString
-
matches
- Specified by:
matches
in interfaceDocumentNameMatcher
-