com.smartgwt.client.data
Class Criteria

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.data.Criteria
Direct Known Subclasses:
Criterion

public class Criteria
extends DataClass

Criteria for selecting only a matching set of records from a DataSource. Criteria can be applied on the client and server. Unless configured otherwise, criteria will generally be applied client-side by ResultSets via ResultSet.applyFilter.

Client- and server-side systems built into Smart GWT understand two criteria formats by default: simple key-value pairs (Criteria) or the AdvancedCriteria format.

Use DataSource.combineCriteria to combine two Criteria objects (including Criteria and AdvancedCriteria) or DataSource.convertCriteria to convert simple Criteria to the AdvancedCriteria format.

When sent to the Smart GWT server, the Java representation of the criteria is described here. When sent to other servers, the operationBinding.dataProtocol affects the format.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
Criteria()
           
Criteria(com.google.gwt.core.client.JavaScriptObject jsObj)
           
Criteria(java.lang.String field, java.lang.String value)
           
 
Method Summary
 void addCriteria(Criteria otherCriteria)
          Adds the criteria from the passed criteria object.
 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.lang.Double[] 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, java.lang.Long value)
           
 void addCriteria(java.lang.String field, java.lang.Object value)
           
 void addCriteria(java.lang.String field, java.lang.String value)
           
 void addCriteria(java.lang.String field, java.lang.String[] value)
           
 AdvancedCriteria asAdvancedCriteria()
          Returns an AdvancedCriteria derived from this Criteria object.
static Criteria[] convertToCriteriaArray(com.google.gwt.core.client.JavaScriptObject nativeArray)
           
static Criteria getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
           
 java.util.Map getValues()
          Return the criteria values as a name-value Map.
 boolean isAdvanced()
          Does this represent an underlying AdvancedCriteria object in JavaScript?
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, 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
 
Methods inherited from class com.smartgwt.client.core.JsObject
equals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObj
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Criteria

public Criteria()

Criteria

public Criteria(java.lang.String field,
                java.lang.String value)

Criteria

public Criteria(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static Criteria getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.String value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.Integer value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.Boolean value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.util.Date value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.Float value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.Long value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.String[] value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.Integer[] value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.Double[] value)

addCriteria

public void addCriteria(java.lang.String field,
                        java.lang.Object value)

addCriteria

public void addCriteria(Criteria otherCriteria)
Adds the criteria from the passed criteria object.

Parameters:
otherCriteria - the passed criteria object

getValues

public java.util.Map getValues()
Return the criteria values as a name-value Map.

Returns:
the criteria values as a Map

convertToCriteriaArray

public static Criteria[] convertToCriteriaArray(com.google.gwt.core.client.JavaScriptObject nativeArray)

isAdvanced

public boolean isAdvanced()
Does this represent an underlying AdvancedCriteria object in JavaScript?

Returns:

asAdvancedCriteria

public AdvancedCriteria asAdvancedCriteria()
Returns an AdvancedCriteria derived from this Criteria object.

Returns: