net.sf.chainedoptions
Interface ChainedOptionStrategy

All Known Implementing Classes:
ExtraItemsStrategy, FirstItemStrategy, NoSortStrategy

public interface ChainedOptionStrategy

Interface for a strategy that is responsible for sorting and filtering the list of available options and providing a reasonable default value. The strategy may also adjust the list of options, for example by adding an option representing any of the available options, like for example an ANY_REGION option, which comes in handy in some search pages.

Author:
Mattias Arthursson, Ulrik Sandberg

Method Summary
 java.util.List adjustAndSort(java.util.List options, java.lang.Object context)
          Sorts the given list of options.
 java.lang.String getDefaultValue(java.util.List options, java.lang.Object context)
          Provides the default value of the given list of options.
 

Method Detail

adjustAndSort

java.util.List adjustAndSort(java.util.List options,
                             java.lang.Object context)
Sorts the given list of options. May also adjust the list of options by adding or removing entries.

Parameters:
options - List of LabelValueBean objects to adjust and sort.
context - may contain any context that might be interesting for the Strategy for fitering or adding values. E.g. the Request object might be passed as context for the Strategy in order to hide some options depending on user access.
Returns:
A sorted list of LabelValueBean objects.
See Also:
LabelValueBean

getDefaultValue

java.lang.String getDefaultValue(java.util.List options,
                                 java.lang.Object context)
Provides the default value of the given list of options.

Parameters:
options - List of LabelValueBean objects where the default value must be found.
context - may contain any context that might be interesting for the Strategy to select the default value.
Returns:
A value representing the default value of the given list of options.


Copyright ? 2005. All Rights Reserved.