Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 2 (11.1.2.1.0)
E17488-02


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.


Nested Class Summary
static class AttributeCriterion.RequiredType
          Defines the possible values for the required attribute of a Criterion

 

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.
 boolean getMatchCase()
          getMatchCase
 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.
 AttributeCriterion.RequiredType getRequired()
           
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.
 void setMatchCase(boolean matchCase)
          setMatchCase
abstract  void setOperator(AttributeDescriptor.Operator operator)
          Sets a value for the operator to use for a search field when performing a query.
 void setRequired(AttributeCriterion.RequiredType required)
          setRequired

 

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

setMatchCase

public void setMatchCase(boolean matchCase)
setMatchCase
Parameters:
matchCase - Sets a value for matchCase for a search field.

getMatchCase

public boolean getMatchCase()
getMatchCase
Returns:
matchCase flag returns a boolean value for matchCase condition for a search field.

setRequired

public void setRequired(AttributeCriterion.RequiredType required)
setRequired
Parameters:
required - sets a value for the required condition of a search field. A search field can either be required or selectively required with other fields or could be optional "required" - mandatory search field "selectively required" - selectively required with other fields "not required" - non mandatory search field

getRequired

public AttributeCriterion.RequiredType getRequired()

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 2 (11.1.2.1.0)
E17488-02


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