public class SortSearchComponent extends Object implements SearchComponent
SearchComponent
for specifying the sort in the search.DISABLE_DEFAULT_SAX_PARAMETER_NAME, MAX_PRIORITY, MIN_PRIORITY, SEARCH_PRIORITY
Constructor and Description |
---|
SortSearchComponent() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkValidInputs(Map<String,SortDefinition> serviceProposedSortsById,
List<Pair<String,Sort.Order>> userSorts)
Checks the user inputs are valid
|
void |
execute(SearchComponentArguments args)
Executes the component.
|
int |
priority()
Get the priority of the component.
|
protected void |
setSearchLanguageAttribute(SearchComponentArguments args)
Sets the SEARCH_LOCALE attribute in request
|
boolean |
supports(SearchComponentArguments args)
Returns
true if the component must be executed . |
public SortSearchComponent()
public int priority()
SearchComponent
priority
in interface SearchComponent
public boolean supports(SearchComponentArguments args)
SearchComponent
true
if the component must be executed
.supports
in interface SearchComponent
args
- the argumentstrue
if the component must be executed
.public void execute(SearchComponentArguments args) throws Exception
SearchComponent
execute
in interface SearchComponent
args
- the argumentsException
- if an exception occurs. Other search components will be attempted to be executedprotected void checkValidInputs(Map<String,SortDefinition> serviceProposedSortsById, List<Pair<String,Sort.Order>> userSorts) throws InvalidUserInputException
serviceProposedSortsById
- The proposed sorts of the service instanceuserSorts
- The user input sortsInvalidUserInputException
- if at least user one input is invalidprotected void setSearchLanguageAttribute(SearchComponentArguments args)
args
- the arguments