Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1)
E10684-04


oracle.adf.view.rich.model
Class AttributeCriterion

java.lang.Object
  extended by oracle.adf.view.rich.model.Criterion
      extended by oracle.adf.view.rich.model.AttributeCriterion


public abstract class AttributeCriterion
extends Criterion

An AttributeCriterion contains information specific to a search field that is based off an attribute as defined by an AttributeDescriptor.

A search field contains various parts such as a label, a list of operators that are relevant to its attribute's type, one or more value fields (date or number support searching between ranges for e.g.).
This interface defines a contract that a model implementor needs to support to facilitate displaying such a search field.


Constructor Summary
AttributeCriterion()
           

 

Method Summary
abstract  AttributeDescriptor getAttribute()
          Returns the AttributeDescriptor instance that this Criterion is based on.
 AttributeDescriptor.ComponentType getComponentType(AttributeDescriptor.Operator operator)
          Returns the component type to be used to render the criterion's value field(s) based on the operator that is passed in.
 java.util.List<? extends java.lang.Object> getModelList()
          Returns a list of model objects to be used by the operands of a criterion.
abstract  AttributeDescriptor.Operator getOperator()
          Gets the default operator to use for the search field.
abstract  java.util.Map<java.lang.String,AttributeDescriptor.Operator> getOperators()
          Gets a map of operators supported by a criterion.
abstract  java.util.List<? extends java.lang.Object> getValues()
          Returns a list of values to be used for a search field.
 boolean hasDependentCriterion(int index)
          Returns true if this criterion instance has dependent criterion.
abstract  boolean isRemovable()
          Whether the criterion can be removed.
abstract  void setOperator(AttributeDescriptor.Operator operator)
          Sets a value for the operator to use for a search field when performing a query.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

AttributeCriterion

public AttributeCriterion()

Method Detail

getAttribute

public abstract AttributeDescriptor getAttribute()
Returns the AttributeDescriptor instance that this Criterion is based on.
Returns:
an AttributeDescriptor instance

getModelList

public java.util.List<? extends java.lang.Object> getModelList()
Returns a list of model objects to be used by the operands of a criterion. Each ordered item in the list is a model object that represents the data for the component, associated with the corresponding operand.

For e.g. in EL notation, modelList[0] should return the model object for the first operand; modelList[1] should return the model object for the second operand etc. The type of the model object returned is based on the component type of the attribute. See below for details.

Returns:
a List of Objects. The default implementation returns a List containing the model associated with the AttributeDescriptor, or an empty list if getAttribute() returns null or if the AttributeDescriptor instance does not provide a model. Subclasses may override this method to return a different list if they choose to.

getComponentType

public AttributeDescriptor.ComponentType getComponentType(AttributeDescriptor.Operator operator)
Returns the component type to be used to render the criterion's value field(s) based on the operator that is passed in.
By default, the component type of the AttributeDescriptor instance is returned but implementors may choose to associate a different component type. For example, for an LOV attribute whose default component type is 'selectOneChoice', it may be necessary to use an 'inputText' as the criterion's search field (instead of 'selectOneChoice') when certain search operators are chosen, so as to allow users to perform wildcard searches.
Parameters:
operator - the Operator instance for which the ComponentType needs to be determined.
Returns:
a AttributeDescriptor.ComponentType enum. The default implementation returns the default ComponentType associated with the attribute (AttributeDescriptor).

hasDependentCriterion

public boolean hasDependentCriterion(int index)
Returns true if this criterion instance has dependent criterion. When the value associated with this criterion instance changes, a true value returned by this method indicates that dependent criterion fields need to be refreshed. By default this method returns false.
Parameters:
index - value indicating the position of the criterion's operand.
Returns:
true if the criterion has dependent criterion. default is false.

getOperator

public abstract AttributeDescriptor.Operator getOperator()
Gets the default operator to use for the search field. This is particularly useful when performing a quick query.
Returns:
an Object

getOperators

public abstract java.util.Map<java.lang.String,AttributeDescriptor.Operator> getOperators()
Gets a map of operators supported by a criterion. A criterion may choose to support only a subset of operators supported by its associated attribute or may choose to support an entirely different set of operators all together.
Returns:
an Map<String, AttributeDescriptor.Operator>

getValues

public abstract java.util.List<? extends java.lang.Object> getValues()
Returns a list of values to be used for a search field.

This is used when search fields display more than one value component for entry. For e.g., when searching between a range of values it is often required to present 2 entry fields for users to enter the range.For boolean data type if the componentType happens to be selectBooleanCheckbox, a List with a single element containing a Boolean value is expected.

Returns:
a List of Objects

isRemovable

public abstract boolean isRemovable()
Whether the criterion can be removed. A true value indicates that the user can remove the criterion from a QueryDescriptor. For e.g., if Criterion objects that are part of a system QueryDescriptor cannot be removed then this method returns false.
Returns:
a boolean.

setOperator

public abstract void setOperator(AttributeDescriptor.Operator operator)
Sets a value for the operator to use for a search field when performing a query. This determines the condition used in the search criteria.
Parameters:
operator - an OperatorType

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1)
E10684-04


Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.