Package org.ametys.web.parameters.view
Class ViewParameterDefinitionParser
- java.lang.Object
-
- org.ametys.runtime.model.AbstractModelItemParser
-
- org.ametys.runtime.model.ElementDefinitionParser
-
- org.ametys.web.parameters.view.ViewParameterDefinitionParser
-
public class ViewParameterDefinitionParser extends ElementDefinitionParser
This class parses the view parameters definition
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
_LOGGER
The logger.-
Fields inherited from class org.ametys.runtime.model.AbstractModelItemParser
_modelItemTypeExtensionPoint
-
-
Constructor Summary
Constructors Constructor Description ViewParameterDefinitionParser(ViewParameterTypeExtensionPoint viewParameterTypeExtensionPoint, ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager)
Creates a view parameters definition parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ViewParameter
_createModelItem(Configuration definitionConfig)
Create the model item to populate it.private Map<String,String>
_parseInheritance(String inheritanceString)
Parse the inheritance argument for view parameters Inheritance works only for template view parameters and zone view parameters<T extends ModelItem>
Tparse(ServiceManager serviceManager, String pluginName, String catalog, Configuration definitionConfig, Model model, ModelItemGroup parent)
Parses an element definition from a XML configuration.-
Methods inherited from class org.ametys.runtime.model.ElementDefinitionParser
_parseAndSetEnumerator, _parseAndSetValidator, _parseDefaultValue, _parseDisableConditions, _parseMultiple, _parseWidget, _parseWidgetParameters, lookupComponents
-
Methods inherited from class org.ametys.runtime.model.AbstractModelItemParser
_getNameConfigurationAttribute, _parseI18nizableText, _parseI18nizableText, _parseName, _parseType, parse
-
-
-
-
Field Detail
-
_LOGGER
protected static final org.slf4j.Logger _LOGGER
The logger.
-
-
Constructor Detail
-
ViewParameterDefinitionParser
public ViewParameterDefinitionParser(ViewParameterTypeExtensionPoint viewParameterTypeExtensionPoint, ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager)
Creates a view parameters definition parser.- Parameters:
viewParameterTypeExtensionPoint
- the extension point to use to get available element typesenumeratorManager
- the enumerator component manager.validatorManager
- the validator component manager.
-
-
Method Detail
-
parse
public <T extends ModelItem> T parse(ServiceManager serviceManager, String pluginName, String catalog, Configuration definitionConfig, Model model, ModelItemGroup parent) throws ConfigurationException
Description copied from class:AbstractModelItemParser
Parses an element definition from a XML configuration.- Overrides:
parse
in classElementDefinitionParser
- Type Parameters:
T
- type of the parsed item- Parameters:
serviceManager
- the service managerpluginName
- the plugin name declaring this item.catalog
- the catalogdefinitionConfig
- the XML configuration of the model item.model
- the model which defines the model itemparent
- the parent of the model item to create. Can be null if the model item to parse has no parent- Returns:
- the parsed model item.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_createModelItem
protected ViewParameter _createModelItem(Configuration definitionConfig) throws ConfigurationException
Description copied from class:AbstractModelItemParser
Create the model item to populate it.- Overrides:
_createModelItem
in classElementDefinitionParser
- Parameters:
definitionConfig
- the model item configuration to use.- Returns:
- the item instantiated.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_parseInheritance
private Map<String,String> _parseInheritance(String inheritanceString)
Parse the inheritance argument for view parameters Inheritance works only for template view parameters and zone view parameters- Parameters:
inheritanceString
- the representation of the inheritance context for the templates- Returns:
- the inheritance mapping between templates and zones
-
-