Module org.refcodes.matcher
Package org.refcodes.matcher
package org.refcodes.matcher
This artifact allows the construction of matchers for building arbitrary
complex matching functionality. It is used to test whether matchee instances
match certain criteria.
Matcher
instances may
get nested in a hierarchy (using e.g. the
OrMatcher
, the
AndMatcher
or the
NotMatcher
types), having different matchers in
combination will do custom matching. Some examples for
Matcher
implementations are the
EqualWithMatcher
, the
PathMatcher
,the
LessThanMatcher
or the
RegExpMatcher
. Use the
MatcherSugar
syntactic sugar mixin for
expressively building your matchers.
Please refer to the refcodes-matcher: Build custom matching logic and match path patterns documentation for an up-to-date and detailed description on the usage of this artifact.
-
ClassDescriptionThe
AbstractMatcheeMatcher
is composed of multipleMatcher
instances queried upon match requests as ofMatchable.isMatching(Object)
.TheAbstractMatcher
provides a base functionality forMatcher
implementations.TheAbstractMatcherComposite
is composed of multipleMatcher
instances queried upon match requests as ofMatchable.isMatching(Object)
.TheAbstractWildcardMatcher
provides a base functionality forMatcher
implementations.The Class WildcardMatcherSubstitutes.AndMatcher<M>AnyMatcher<M>An ANY implementation of aMatcher
which always returnstrue
.An EQUAL WITHMatcher
, comparing its matchee with the matchee provided to theEqualWithMatcher.isMatching(Object)
method for equality.GreaterOrEqualThanMatcher<M extends Comparable<M>>A GREATER OR EQUAL THANMatcher
, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)
method using theComparable.compareTo(Object)
method to be implemented by the matchees.GreaterThanMatcher<M extends Comparable<M>>A GREATER THANMatcher
, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)
method using theComparable.compareTo(Object)
method to be implemented by the matchees.A IS ASSIGNABLE FROM implementation of aMatcher
by type.LessOrEqualThanMatcher<M extends Comparable<M>>A LESS OR EQUAL THANMatcher
, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)
method using theComparable.compareTo(Object)
method to be implemented by the matchees.LessThanMatcher<M extends Comparable<M>>A LESS THANMatcher
, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)
method using theComparable.compareTo(Object)
method to be implemented by the matchees.Matchable<M>Matcher<M>The matcher is used to test whether a matchee matches certain criteria.The purpose of aMatcherSchema
is automatically generate documentation ofMatcher
structures.Declarative syntactic sugar which may be statically imported in order to allow declarative definitions for theMatcher
elements.NoneMatcher<M>A NONE implementation of aMatcher
which always returnsfalse
.A NOT EQUAL WITHMatcher
, comparing its matchee with the matchee provided to theNotEqualWithMatcher.isMatching(Object)
method for equality.NotMatcher<M>OrMatcher<M>ThePathMatcher
providesWildcardMatcher
functionality for matching paths: ThePathMatcher
matches its ANT like path pattern against the path provided to thePathMatcher.isMatching(String)
and the like methods.The REGEXPRegExpMatcher
providesWildcardMatcher
functionality for regular expressionPattern
matching.AWildcardMatcher
is aMatcher
providing additional means to work with the wildcards and their wildcard substitutes in case of a match as ofMatchable.isMatching(Object)
.