Class Criteria

All Implemented Interfaces:
HasHandlers
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.

  • Constructor Details

  • Method Details

    • getOrCreateRef

      public static Criteria getOrCreateRef(JavaScriptObject jsObj)
    • addCriteria

      public void addCriteria(String field, String value)
    • addCriteria

      public void addCriteria(String field, Boolean value)
    • addCriteria

      public void addCriteria(String field, Integer value)
    • addCriteria

      public void addCriteria(String field, Long value)
    • addCriteria

      public void addCriteria(String field, Float value)
    • addCriteria

      public void addCriteria(String field, Double value)
    • addCriteria

      public void addCriteria(String field, Date value)
    • addCriteria

      public void addCriteria(String field, String[] value)
    • addCriteria

      public void addCriteria(String field, Boolean[] value)
    • addCriteria

      public void addCriteria(String field, Integer[] value)
    • addCriteria

      public void addCriteria(String field, Long[] value)
    • addCriteria

      public void addCriteria(String field, Float[] value)
    • addCriteria

      public void addCriteria(String field, Double[] value)
    • addCriteria

      public void addCriteria(String field, Object value)
    • addCriteria

      public void addCriteria(Criteria otherCriteria)
      Adds the criteria from the passed criteria object.
      Parameters:
      otherCriteria - the passed criteria object
    • getValues

      public Map getValues()
      Return the criteria values as a name-value Map.
      Returns:
      the criteria values as a Map
    • convertToCriteriaArray

      public static Criteria[] convertToCriteriaArray(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: