public class CompositeFilters extends Object
SubscriptionFilter
utilities that combine other filters with ',' (or) operations,
'&' (and) operations, and '!' (not) operations. Grouping with opening '(' and closing ')' parenthesis
is also supported.Modifier and Type | Method and Description |
---|---|
static RecordOnlyFilter |
forRecords(Collection<DataRecord> records)
Returns filter that accepts only a specified collection of records.
|
static QDFilterFactory |
getFactory(DataScheme scheme)
Returns a factory that will parse a filter specification into a filter with project-specific
filters defined in the
scheme as with valueOf(String, DataScheme) method. |
static QDFilter |
makeAnd(QDFilter one,
QDFilter two)
Returns new filter that performs logical-and operation on filters.
|
static SubscriptionFilter |
makeAnd(SubscriptionFilter one,
SubscriptionFilter two)
Deprecated.
Use
makeAnd(QDFilter, QDFilter) instead and use QDFilter.ANYTHING
instead of null arguments. |
static QDFilter |
makeNot(QDFilter filter)
Returns new filter that performs logical-not operation on filters.
|
static SubscriptionFilter |
makeNot(SubscriptionFilter filter)
Deprecated.
Use
makeNot(QDFilter) instead and use QDFilter.ANYTHING
instead of null arguments. |
static QDFilter |
makeOr(QDFilter one,
QDFilter two)
Returns new filter that performs logical-or operation on filters.
|
static SubscriptionFilter |
makeOr(SubscriptionFilter one,
SubscriptionFilter two)
Deprecated.
Use
makeOr(QDFilter, QDFilter) instead and use QDFilter.ANYTHING
instead of null arguments. |
static QDFilter |
toStableFilter(SubscriptionFilter filter)
Returns a stable filter that is the same or more encompassing as this filter.
|
static QDFilter |
valueOf(String spec,
DataScheme scheme)
Parses filter specification and combines them with project-specific filters defined in the
scheme with ',' (or) operations, '&' (and) operations, and '!' (not) operations. |
static QDFilter |
valueOf(String spec,
String name,
DataScheme scheme)
Parses filter specification and attaches project-specific name string to it.
|
static SubscriptionFilter |
valueOf(String spec,
SubscriptionFilterFactory baseFactory)
Parses filter specification and combines filters defined by
baseFactory
with ',' (or) operations, '&' (and) operations, and '!' (not) operations. |
public static QDFilter valueOf(String spec, DataScheme scheme)
scheme
with ',' (or) operations, '&' (and) operations, and '!' (not) operations.
Grouping with opening '(' and closing ')' parenthesis is also supported.
This method shows warning if it suspects that there is a typo in record name.NullPointerException
- if spec is null.FilterSyntaxException
- if spec is invalid.public static QDFilter valueOf(String spec, String name, DataScheme scheme)
IllegalArgumentException
- if name is invalid.valueOf(String, DataScheme)
public static QDFilterFactory getFactory(DataScheme scheme)
scheme
as with valueOf(String, DataScheme)
method.public static SubscriptionFilter valueOf(String spec, SubscriptionFilterFactory baseFactory)
baseFactory
with ',' (or) operations, '&' (and) operations, and '!' (not) operations.
Grouping with opening '(' and closing ')' parenthesis is also supported.
Anything that is not supported by baseFactory
(when QDFilterFactory.createFilter(String)
returns null)
is run through PatternFilter
.NullPointerException
- if spec is null.FilterSyntaxException
- if spec is invalid.public static RecordOnlyFilter forRecords(Collection<DataRecord> records)
public static QDFilter toStableFilter(SubscriptionFilter filter)
QDFilter.toStableFilter()
public static QDFilter makeOr(QDFilter one, QDFilter two)
QDFilter.ANYTHING
.public static SubscriptionFilter makeOr(SubscriptionFilter one, SubscriptionFilter two)
makeOr(QDFilter, QDFilter)
instead and use QDFilter.ANYTHING
instead of null arguments.public static QDFilter makeAnd(QDFilter one, QDFilter two)
QDFilter.ANYTHING
.public static SubscriptionFilter makeAnd(SubscriptionFilter one, SubscriptionFilter two)
makeAnd(QDFilter, QDFilter)
instead and use QDFilter.ANYTHING
instead of null arguments.public static QDFilter makeNot(QDFilter filter)
QDFilter.ANYTHING
.
Application of this method to QDFilter.ANYTHING
will result in
QDFilter.NOTHING
and vice versa.
public static SubscriptionFilter makeNot(SubscriptionFilter filter)
makeNot(QDFilter)
instead and use QDFilter.ANYTHING
instead of null arguments.Copyright © 2002-2018 Devexperts LLC. All Rights Reserved.