poco.sdk.DefaultMatcher module
- class DefaultMatcher[源代码]
基类:
IMatcher
Default matcher implementation for poco hierarchy traversing. Including logical query condition and predicate expression. When traversing through the hierarchy tree, matcher will apply the match method on each node of the tree.
The formal definition of query condition as follows:
expr := (op0, (expr0, expr1, ...)) expr := (op1, (arg1, arg2))
op0
str
is logical operator (‘or’ or ‘and’) which has the same semantics as in python, e.g. ‘or’ means this expression/condition matches if any of the exprN matchesop1
str
is comparator, can be one of as follows:op1 := 'attr=' op1 := 'attr.*=' op1 := ... (other customized)
attr=
corresponds toEqualizationComparator
.attr.*=
corresponds toRegexpComparator
.
The
op1
must be a string. TheMatcher
will help to map toComparator
object.
- class EqualizationComparator[源代码]
基类:
object
Compare two objects using the native equivalence (==) comparison operator