Class AbstractDefaultSearchCriterionDefinition
java.lang.Object
org.ametys.runtime.parameter.Parameter<MetadataType>
org.ametys.web.frontoffice.search.metamodel.impl.AbstractDefaultSearchCriterionDefinition
- All Implemented Interfaces:
SearchCriterionDefinition
- Direct Known Subclasses:
ContentSearchCriterionDefinition,DublinCoreSearchCriterionDefinition,PageSearchCriterionDefinition,PageTitleSearchCriterionDefinition,SitemapSearchCriterionDefinition,SiteSearchCriterionDefinition,WordingSearchCriterionDefinition
public abstract class AbstractDefaultSearchCriterionDefinition
extends Parameter<MetadataType>
implements SearchCriterionDefinition
Default implementation of
SearchCriterionDefinition-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDefaultSearchCriterionDefinition(String id, String pluginName, I18nizableText label, MetadataType type, Optional<String> widget, Optional<Map<String, I18nizableText>> widgetParams, Optional<Enumerator> enumerator, Optional<Validator> validator, Optional<Object> defaultValue, Optional<Searchable> searchable) Constructs aSearchCriterionDefinition -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddispose()Releases and destroys any resource it owns.getEnumeratedValues(Map<String, Object> contextualParameters) Gets the enumerated entries.Gets the (Searchable) the criterion belongs to.booleanReturnstrueif this criterion definition is enumeratedbooleanReturnstrueif this criterion definition is enumerated but can contains too much datatoJSON()Gets the JSON representation of this criterion definitionMethods inherited from class org.ametys.runtime.parameter.Parameter
getDefaultValue, getDescription, getEnumerator, getId, getLabel, getPluginName, getType, getValidator, getWidget, getWidgetParameters, setDefaultValue, setDescription, setEnumerator, setId, setLabel, setPluginName, setType, setValidator, setWidget, setWidgetParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.web.frontoffice.search.metamodel.SearchCriterionDefinition
getContextPrefixLabels, getEmptyValueQuery, getId, getLabel, getQuery, getType, getValidator, getWidget, getWidgetParameters
-
Constructor Details
-
AbstractDefaultSearchCriterionDefinition
public AbstractDefaultSearchCriterionDefinition(String id, String pluginName, I18nizableText label, MetadataType type, Optional<String> widget, Optional<Map<String, I18nizableText>> widgetParams, Optional<Enumerator> enumerator, Optional<Validator> validator, Optional<Object> defaultValue, Optional<Searchable> searchable) Constructs aSearchCriterionDefinition- Parameters:
id- The idpluginName- The plugin namelabel- The labeltype- The typewidget- The widgetwidgetParams- The widget parametersenumerator- The enumeratorvalidator- The validatordefaultValue- The default valuesearchable- theSearchable
-
-
Method Details
-
getSearchable
Description copied from interface:SearchCriterionDefinitionGets the (Searchable) the criterion belongs to.
Important: if the criterion definition is brought by a specific Searchable, then this searchable must be returned in a non-emptyOptional. If the criterion definition is brought bySearchServiceCommonImpls, then anOptional.empty()must be returned.- Specified by:
getSearchablein interfaceSearchCriterionDefinition- Returns:
- the (
Searchable) the criterion belongs to.
-
isEnumerated
Description copied from interface:SearchCriterionDefinitionReturnstrueif this criterion definition is enumerated- Specified by:
isEnumeratedin interfaceSearchCriterionDefinition- Returns:
trueif this criterion definition is enumerated
-
isTooBigForStaticEnumerator
Description copied from interface:SearchCriterionDefinitionReturnstrueif this criterion definition is enumerated but can contains too much data- Specified by:
isTooBigForStaticEnumeratorin interfaceSearchCriterionDefinition- Returns:
trueif this criterion definition is enumerated but can contains too much data
-
getEnumeratedValues
Description copied from interface:SearchCriterionDefinitionGets the enumerated entries.
Must be non-emptyifSearchCriterionDefinition.isEnumerated()returnstrue.- Specified by:
getEnumeratedValuesin interfaceSearchCriterionDefinition- Parameters:
contextualParameters- The contextual parameters- Returns:
- the enumerated entries
-
toJSON
Description copied from interface:SearchCriterionDefinitionGets the JSON representation of this criterion definition- Specified by:
toJSONin interfaceSearchCriterionDefinition- Returns:
- the JSON representation of this criterion definition
- Throws:
Exception- if an exception occurs
-
dispose
Releases and destroys any resource it owns.
-