public class Criterion extends Criteria
A criterion is part of the definition of an AdvancedCriteria
object, which is used to filter records according to search criteria.
A
criterion consists of an operator
and typically a fieldName
from a Record
and a value
to compare to. However some operators either don't require a value
(eg, isNull) or act on other criteria rather than directly on a Record
's fields (eg,
the "and" and "or" logical operators).
Constructor and Description |
---|
Criterion() |
Criterion(Criterion c) |
Criterion(com.google.gwt.core.client.JavaScriptObject jsObj) |
Criterion(OperatorId operator) |
Criterion(OperatorId operator,
Criterion[] criterias) |
Criterion(java.lang.String fieldName,
OperatorId operator) |
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Boolean value)
Constructor for Criterion with fieldName, operator and value.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Boolean[] value) |
Criterion(java.lang.String fieldName,
OperatorId operator,
java.util.Date value)
Constructor for Criterion with fieldName, operator and value.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.util.Date[] value) |
Criterion(java.lang.String fieldName,
OperatorId operator,
java.util.Date start,
java.util.Date end)
Constructor for Criterion with fieldName, operator, start and end values.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Float value)
Constructor for Criterion with fieldName, operator and value.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Float[] value) |
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Float start,
java.lang.Float end)
Constructor for Criterion with fieldName, operator, start and end values.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Integer value)
Constructor for Criterion with fieldName, operator and value.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Integer[] value) |
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Integer start,
java.lang.Integer end)
Constructor for Criterion with fieldName, operator, start and end values.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Long value)
Constructor for Criterion with fieldName, operator and value.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Long[] value) |
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.Long start,
java.lang.Long end)
Constructor for Criterion with fieldName, operator, start and end values.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.String value)
Constructor for Criterion with fieldName, operator and value.
|
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.String[] value) |
Criterion(java.lang.String fieldName,
OperatorId operator,
java.lang.String start,
java.lang.String end)
Constructor for Criterion with fieldName, operator, start and end values.
|
Modifier and Type | Method and Description |
---|---|
void |
addCriteria(Criterion c)
Adds a new criteria.
|
void |
addCriteria(java.lang.String field,
java.lang.Boolean value) |
void |
addCriteria(java.lang.String field,
java.lang.Boolean[] value) |
void |
addCriteria(java.lang.String field,
java.util.Date value) |
void |
addCriteria(java.lang.String field,
java.util.Date[] value) |
void |
addCriteria(java.lang.String field,
java.lang.Float value) |
void |
addCriteria(java.lang.String field,
java.lang.Float[] value) |
void |
addCriteria(java.lang.String field,
java.lang.Integer value) |
void |
addCriteria(java.lang.String field,
java.lang.Integer[] value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.lang.Boolean value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.lang.Boolean[] value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.util.Date value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.util.Date[] value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.lang.Float value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.lang.Float[] value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.lang.Integer value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.lang.Integer[] value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.lang.String value) |
void |
addCriteria(java.lang.String field,
OperatorId op,
java.lang.String[] value) |
void |
addCriteria(java.lang.String field,
java.lang.String value) |
void |
addCriteria(java.lang.String field,
java.lang.String[] value) |
void |
appendToCriterionList(Criterion c) |
void |
buildCriterionFromList(OperatorId operator,
Criterion[] criterias) |
Criterion[] |
getCriteria()
Returns an array of sub-criteria for this criterion.
|
java.lang.String |
getFieldName()
Name of the field in each
Record that this criterion applies to. |
OperatorId |
getOperator()
Operator this criterion applies.
|
static Criterion |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.Boolean |
getValueAsBoolean()
Retrieves the specified value for this criterion.
|
java.util.Date |
getValueAsDate()
Retrieves the specified value for this criterion.
|
java.lang.Float |
getValueAsFloat()
Retrieves the specified value for this criterion.
|
java.lang.Integer |
getValueAsInt()
Synonym of
getValueAsInteger() . |
int[] |
getValueAsIntArray()
Retrieves the specified value for this criterion.
|
java.lang.Integer |
getValueAsInteger()
Retrieves the specified value for this criterion.
|
java.lang.String |
getValueAsString()
Retrieves the specified value for this criterion.
|
java.lang.String[] |
getValueAsStringArray()
Retrieves the specified value for this criterion.
|
void |
markAdvancedCriteria() |
void |
setFieldName(java.lang.String fieldName)
Name of the field in each
Record that this criterion applies to. |
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj) |
void |
setOperator(OperatorId operator)
Operator this criterion applies.
|
void |
unmarkAdvancedCriteria() |
addCriteria, addCriteria, addCriteria, addCriteria, asAdvancedCriteria, convertToCriteriaArray, getValues, isAdvanced
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject
public Criterion()
public Criterion(com.google.gwt.core.client.JavaScriptObject jsObj)
public Criterion(Criterion c)
public Criterion(OperatorId operator, Criterion[] criterias)
public Criterion(OperatorId operator)
public Criterion(java.lang.String fieldName, OperatorId operator)
public Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Integer value)
fieldName
- the field nameoperator
- the operatorvalue
- the valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Integer start, java.lang.Integer end)
OperatorId.BETWEEN
or OperatorId.BETWEEN_INCLUSIVE
fieldName
- the field nameoperator
- the operatorstart
- the start valueend
- the end valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.String value)
fieldName
- the field nameoperator
- the operatorvalue
- the valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.String start, java.lang.String end)
OperatorId.BETWEEN
or OperatorId.BETWEEN_INCLUSIVE
fieldName
- the field nameoperator
- the operatorstart
- the start valueend
- the end valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Float value)
fieldName
- the field nameoperator
- the operatorvalue
- the valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Float start, java.lang.Float end)
OperatorId.BETWEEN
or OperatorId.BETWEEN_INCLUSIVE
fieldName
- the field nameoperator
- the operatorstart
- the start valueend
- the end valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.util.Date value)
fieldName
- the field nameoperator
- the operatorvalue
- the valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.util.Date start, java.util.Date end)
OperatorId.BETWEEN
or OperatorId.BETWEEN_INCLUSIVE
fieldName
- the field nameoperator
- the operatorstart
- the start valueend
- the end valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Boolean value)
fieldName
- the field nameoperator
- the operatorvalue
- the valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Long value)
fieldName
- the field nameoperator
- the operatorvalue
- the valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Long start, java.lang.Long end)
OperatorId.BETWEEN
or OperatorId.BETWEEN_INCLUSIVE
fieldName
- the field nameoperator
- the operatorstart
- the start valueend
- the end valuepublic Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Integer[] value)
public Criterion(java.lang.String fieldName, OperatorId operator, java.lang.String[] value)
public Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Float[] value)
public Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Long[] value)
public Criterion(java.lang.String fieldName, OperatorId operator, java.util.Date[] value)
public Criterion(java.lang.String fieldName, OperatorId operator, java.lang.Boolean[] value)
public static Criterion getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setFieldName(java.lang.String fieldName)
Record
that this criterion applies to. Not applicable for a
criterion with sub-criteria
. Can be specified as a dataPath to
allow matching nested objects. Use '/' as delimiters for dataPath. See dataPath for more information.fieldName
- . See String
. Default value is nullpublic java.lang.String getFieldName()
Record
that this criterion applies to. Not applicable for a
criterion with sub-criteria
. Can be specified as a dataPath to
allow matching nested objects. Use '/' as delimiters for dataPath. See dataPath for more information.String
public void setOperator(OperatorId operator)
operator
- operator Default value is nullpublic OperatorId getOperator()
public void addCriteria(Criterion c)
If the present criteria operation is "and", the new criteria is appended to the criteria list.
Otherwise, the existing criteria is replaced with an "and" criteria, with two sub-criteria: the existing criteria, and the passed criteria.
Note that if the existing criteria was empty (as would happen if new AdvancedCriteria() were called with no arguments), an "and" operator will still be introduced, but the passed criteria will be the only sub-criteria.
c
- the passed criteria objectpublic void addCriteria(java.lang.String field, java.lang.String value)
addCriteria
in class Criteria
addCriteria(Criterion)
public void addCriteria(java.lang.String field, java.lang.Integer value)
addCriteria
in class Criteria
public void addCriteria(java.lang.String field, java.lang.Float value)
addCriteria
in class Criteria
public void addCriteria(java.lang.String field, java.util.Date value)
addCriteria
in class Criteria
public void addCriteria(java.lang.String field, java.lang.Boolean value)
addCriteria
in class Criteria
public void addCriteria(java.lang.String field, java.lang.String[] value)
addCriteria
in class Criteria
public void addCriteria(java.lang.String field, java.lang.Integer[] value)
addCriteria
in class Criteria
public void addCriteria(java.lang.String field, java.lang.Float[] value)
public void addCriteria(java.lang.String field, java.util.Date[] value)
public void addCriteria(java.lang.String field, java.lang.Boolean[] value)
public void addCriteria(java.lang.String field, OperatorId op, java.lang.String value)
addCriteria(Criterion)
public void addCriteria(java.lang.String field, OperatorId op, java.lang.Integer value)
public void addCriteria(java.lang.String field, OperatorId op, java.lang.Float value)
public void addCriteria(java.lang.String field, OperatorId op, java.util.Date value)
public void addCriteria(java.lang.String field, OperatorId op, java.lang.Boolean value)
public void addCriteria(java.lang.String field, OperatorId op, java.lang.String[] value)
public void addCriteria(java.lang.String field, OperatorId op, java.lang.Integer[] value)
public void addCriteria(java.lang.String field, OperatorId op, java.lang.Float[] value)
public void addCriteria(java.lang.String field, OperatorId op, java.util.Date[] value)
public void addCriteria(java.lang.String field, OperatorId op, java.lang.Boolean[] value)
public void buildCriterionFromList(OperatorId operator, Criterion[] criterias)
public void appendToCriterionList(Criterion c)
public void markAdvancedCriteria()
public void unmarkAdvancedCriteria()
public Criterion[] getCriteria()
AND
or OR
.public java.lang.String getValueAsString()
#getCriteria(),sub criteria
.public final java.lang.Integer getValueAsInt()
getValueAsInteger()
.public java.lang.Integer getValueAsInteger()
#getCriteria(),sub criteria
.public java.lang.Float getValueAsFloat()
#getCriteria(),sub criteria
.public java.util.Date getValueAsDate()
#getCriteria(),sub criteria
.public java.lang.Boolean getValueAsBoolean()
#getCriteria(),sub criteria
.public java.lang.String[] getValueAsStringArray()
#getCriteria(),sub criteria
.public int[] getValueAsIntArray()
#getCriteria(),sub criteria
.