com.anasoft.os.daofusion.criteria
Class SimpleFilterCriterionProvider

java.lang.Object
  extended by com.anasoft.os.daofusion.criteria.SimpleFilterCriterionProvider
All Implemented Interfaces:
FilterCriterionProvider

public abstract class SimpleFilterCriterionProvider
extends java.lang.Object
implements FilterCriterionProvider

Base class for FilterCriterionProvider implementations that use either filter object or direct values filter data concept.

If you wish to combine both filter data concepts together, we recommend writing your own specific FilterCriterionProvider implementation.

Author:
vojtech.szocs
See Also:
FilterCriterionProvider

Nested Class Summary
static class SimpleFilterCriterionProvider.FilterDataStrategy
          Type of the strategy for passing filter data to the given FilterCriterionProvider.
 
Constructor Summary
SimpleFilterCriterionProvider()
          Creates a new Criterion instance provider which doesn't expect any filter values (subclasses have to manage filter data on their own).
SimpleFilterCriterionProvider(SimpleFilterCriterionProvider.FilterDataStrategy strategy, int expectedValueCount)
          Creates a new Criterion instance provider which enforces non-null values within the appropriate value array by default.
SimpleFilterCriterionProvider(SimpleFilterCriterionProvider.FilterDataStrategy strategy, int expectedValueCount, boolean checkNullValues)
          Creates a new Criterion instance provider.
 
Method Summary
 boolean enabled(java.lang.Object[] filterObjectValues, java.lang.Object[] directValues)
          Returns a flag indicating whether to use this provider during the FilterCriterion instance processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.anasoft.os.daofusion.criteria.FilterCriterionProvider
getCriterion
 

Constructor Detail

SimpleFilterCriterionProvider

public SimpleFilterCriterionProvider(SimpleFilterCriterionProvider.FilterDataStrategy strategy,
                                     int expectedValueCount,
                                     boolean checkNullValues)
Creates a new Criterion instance provider.

Parameters:
strategy - Type of the strategy for passing filter data to this provider.
expectedValueCount - Expected length of the filterObjectValuePaths or directValues array, depending on the chosen strategy.
checkNullValues - true to enforce non-null values within the value array (depending on the chosen strategy), false to skip the null value check.

SimpleFilterCriterionProvider

public SimpleFilterCriterionProvider(SimpleFilterCriterionProvider.FilterDataStrategy strategy,
                                     int expectedValueCount)
Creates a new Criterion instance provider which enforces non-null values within the appropriate value array by default.

Parameters:
strategy - Type of the strategy for passing filter data to this provider.
expectedValueCount - Expected length of the filterObjectValuePaths or directValues array, depending on the chosen strategy.

SimpleFilterCriterionProvider

public SimpleFilterCriterionProvider()
Creates a new Criterion instance provider which doesn't expect any filter values (subclasses have to manage filter data on their own).

Method Detail

enabled

public boolean enabled(java.lang.Object[] filterObjectValues,
                       java.lang.Object[] directValues)
Description copied from interface: FilterCriterionProvider
Returns a flag indicating whether to use this provider during the FilterCriterion instance processing.

Use this method for disabling the Criterion instance provider in certain situations, for example:

Note that this method is called before each FilterCriterionProvider.getCriterion(String, Object[], Object[]) invocation during the FilterCriterion instance processing.

Specified by:
enabled in interface FilterCriterionProvider
Parameters:
filterObjectValues - Values extracted from the filter object.
directValues - Values provided directly by the user.
Returns:
true to use this provider during the FilterCriterion instance processing, false otherwise.
See Also:
FilterCriterionProvider.enabled(java.lang.Object[], java.lang.Object[])


Copyright © 2008-2009 ANASOFT and contributors. All Rights Reserved.