public interface FilterByCriteria extends Filter
Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_ALL
Allow only if all values are satisfied.
|
static int |
ALLOW_ANY
Allow if some value is satisfied.
|
static int |
ALLOW_NONE
Allow if none of the specified values are satisfied.
|
Modifier and Type | Method and Description |
---|---|
void |
addProperties(FilterByCriteria filter)
Add all the specified filter properties.
|
void |
addProperty(String propertyId,
Object minValue,
boolean minValueIncluded,
Object maxValue,
boolean maxValueIncluded,
Collection allowedValues,
int allowMode)
Specifies a property for the filter.
|
boolean |
addProperty(String propertyId,
String filterCriteria)
Specifies a property for the filter in a unstructured way.
|
FilterByCriteria |
cloneFilter()
Create an exact copy of this filter instance.
|
boolean |
containsProperty(Collection propIds)
Check if a filter is defined for any of the property identifiers given.
|
boolean |
containsProperty(String propertyId)
Check if the given property filter has been defined.
|
String |
getExtraInfo(String propertyId) |
String |
getGt()
The greater than symbol.
|
String |
getGtOrEq()
The greater or equals than symbol.
|
Locale |
getLocale()
The criteria always belongs to a locale.
|
String |
getLt()
The less than symbol.
|
String |
getLtOrEq()
The less or equals than symbol.
|
List |
getPropertyAllowedValues(String propertyId)
Get the set of allowed values for the property.
|
int |
getPropertyAllowMode(String propertyId)
Get the allow mode for a property.
|
String[] |
getPropertyIds()
Retgrieve the property ids. specified for this filter.
|
Comparable |
getPropertyMaxValue(String propertyId)
Get the max. value allowed for the property in the filter.
|
Comparable |
getPropertyMinValue(String propertyId)
Get the min. value allowed for the property in the filter.
|
int |
getPropertyPriority(String propertyId)
Get the prioority for a given property defined in the filter.
|
String |
getVariableName(String propertyId) |
String |
getWildcard()
The wildcard symbol used by the filter to compare properties.
|
boolean |
maxValueIncluded(String propertyId)
Check if max. value defined must be considered as valid.
|
boolean |
minValueIncluded(String propertyId)
Check if min. value defined must be considered as valid.
|
boolean |
pass(String propertyId,
Object value)
Check if a value satisfies a defined property filter.
|
void |
removeAllProperty()
Clear filter.
|
void |
removeProperties(FilterByCriteria filter)
Remove all the specified filter properties.
|
void |
removeProperty(String propertyId)
Remove property from the filter.
|
void |
setExtraInfo(String propertyId,
String extraInfo)
Set additional information regarding the property.
|
void |
setFilterCondition(String booleanExpression)
Define the condition to be applied to the set of property filters when executing the
pass(Object) method. |
void |
setLocale(Locale locale) |
void |
setVariableName(String propertyId,
String varName)
An alias or variable to be assigned to the property .
|
static final int ALLOW_ALL
static final int ALLOW_ANY
static final int ALLOW_NONE
Locale getLocale()
void setLocale(Locale locale)
void addProperty(String propertyId, Object minValue, boolean minValueIncluded, Object maxValue, boolean maxValueIncluded, Collection allowedValues, int allowMode)
propertyId
- The property to set.minValue
- The minimun value allowed for the property.minValueIncluded
- The minimun value is considered as a valid value.maxValue
- The maximum value allowed for the property.maxValueIncluded
- The maximum value is considered as a valid value.allowedValues
- A set of values allowed.allowMode
- boolean addProperty(String propertyId, String filterCriteria)
propertyId
- The property to set.filterCriteria
- The criteria for the property.
Operators are allowed here: wildcard, greater than, less than and comma. e.g: ">1000",
"Rev*", "1000, 1002, 1003".void addProperties(FilterByCriteria filter)
String[] getPropertyIds()
boolean containsProperty(String propertyId)
boolean containsProperty(Collection propIds)
propIds
- A collection of property identifiers.void removeProperty(String propertyId)
void removeProperties(FilterByCriteria filter)
void removeAllProperty()
int getPropertyPriority(String propertyId)
propertyId
- Comparable getPropertyMinValue(String propertyId)
boolean minValueIncluded(String propertyId)
Comparable getPropertyMaxValue(String propertyId)
boolean maxValueIncluded(String propertyId)
List getPropertyAllowedValues(String propertyId)
int getPropertyAllowMode(String propertyId)
ALLOW_
constants defined.void setVariableName(String propertyId, String varName)
For more details see setFilterCondition(String logicalExpression)
method.
void setExtraInfo(String propertyId, String extraInfo)
void setFilterCondition(String booleanExpression)
pass(Object)
method.booleanExpression
- A logical expression where we can combine the different property
pass results in order to calculate the overall filter result. Boolean AND, OR and
NOT operators are supported.
Next some logical expressions samples:
As you can see, powerful and complex boolean expressions can be defined.
String getWildcard()
String getGt()
String getGtOrEq()
String getLt()
String getLtOrEq()
boolean pass(String propertyId, Object value)
propertyId
- The property to pass.value
- The value to check.FilterByCriteria cloneFilter()
Copyright © 2012–2017 JBoss by Red Hat. All rights reserved.