Package org.ametys.runtime.parameter
Class AbstractParameterParser<P extends Parameter<T>,T extends Enum<T>>
- java.lang.Object
-
- org.ametys.runtime.parameter.AbstractParameterParser<P,T>
-
- Type Parameters:
P- the actual type of parameter.T- the actual type of parameter type.
- Direct Known Subclasses:
DefaultContentType.MetadataAndRepeaterDefinitionParser,StaticUserPreferenceProvider.UserPreferenceParser,SynchronizeContentsCollectionModelExtensionPoint.SynchronizableContentsCollectionModelParameterParser
@Deprecated public abstract class AbstractParameterParser<P extends Parameter<T>,T extends Enum<T>> extends Object
Deprecated.UseElementDefinitionParserinsteadParameterparser from an XML configuration.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger__LOGGERDeprecated.protected ThreadSafeComponentManager<Enumerator>_enumeratorManagerDeprecated.The enumerators component manager.private Map<P,String>_enumeratorsToLookupDeprecated.protected ThreadSafeComponentManager<Validator>_validatorManagerDeprecated.The validators component manager.private Map<P,String>_validatorsToLookupDeprecated.
-
Constructor Summary
Constructors Constructor Description AbstractParameterParser(ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager)Deprecated.Creates an AbstractParameterParser.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void_additionalParsing(ServiceManager manager, String pluginName, Configuration parameterConfig, String parameterId, P parameter)Deprecated.Called for additional parsing.
Default implementation does nothing.protected abstract P_createParameter(Configuration parameterConfig)Deprecated.Create the parameter to populate it.protected void_parseAndSetEnumerator(String pluginName, P parameter, String parameterId, Configuration parameterConfig)Deprecated.Parses the enumerator.protected void_parseAndSetValidator(String pluginName, P parameter, String parameterId, Configuration parameterConfig)Deprecated.Parses the validator.protected abstract Object_parseDefaultValue(Configuration parameterConfig, P parameter)Deprecated.Parses the default value.protected I18nizableText_parseI18nizableText(Configuration config, String pluginName, String name)Deprecated.Parses an i18n text.protected abstract String_parseId(Configuration parameterConfig)Deprecated.Parses the id.protected abstract T_parseType(Configuration parameterConfig)Deprecated.Parses the type.protected String_parseWidget(Configuration parameterConfig)Deprecated.Parses the widget.protected Map<String,I18nizableText>_parseWidgetParameters(Configuration parameterConfig, String pluginName)Deprecated.Parses the widget's parametersvoidlookupComponents()Deprecated.Retrieves local validators and enumerators components and set them into previous parameter parsed.PparseParameter(ServiceManager manager, String pluginName, Configuration parameterConfig)Deprecated.Parses a parameter from a XML configuration.
-
-
-
Field Detail
-
__LOGGER
private static final org.slf4j.Logger __LOGGER
Deprecated.
-
_enumeratorManager
protected ThreadSafeComponentManager<Enumerator> _enumeratorManager
Deprecated.The enumerators component manager.
-
_validatorManager
protected ThreadSafeComponentManager<Validator> _validatorManager
Deprecated.The validators component manager.
-
_validatorsToLookup
private final Map<P extends Parameter<T>,String> _validatorsToLookup
Deprecated.
-
-
Constructor Detail
-
AbstractParameterParser
public AbstractParameterParser(ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager)
Deprecated.Creates an AbstractParameterParser.- Parameters:
enumeratorManager- the enumerator component manager.validatorManager- the validator component manager.
-
-
Method Detail
-
parseParameter
public P parseParameter(ServiceManager manager, String pluginName, Configuration parameterConfig) throws ConfigurationException
Deprecated.Parses a parameter from a XML configuration.- Parameters:
manager- the service manager.pluginName- the plugin name declaring this parameter.parameterConfig- the XML configuration.- Returns:
- the parsed parameter.
- Throws:
ConfigurationException- if the configuration is not valid.
-
lookupComponents
public void lookupComponents() throws Exception
Deprecated.Retrieves local validators and enumerators components and set them into previous parameter parsed.- Throws:
Exception- if an error occurs.
-
_createParameter
protected abstract P _createParameter(Configuration parameterConfig) throws ConfigurationException
Deprecated.Create the parameter to populate it.- Parameters:
parameterConfig- the parameter configuration to use.- Returns:
- the parameter instantiated.
- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseId
protected abstract String _parseId(Configuration parameterConfig) throws ConfigurationException
Deprecated.Parses the id.- Parameters:
parameterConfig- the parameter configuration to use.- Returns:
- the id.
- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseI18nizableText
protected I18nizableText _parseI18nizableText(Configuration config, String pluginName, String name) throws ConfigurationException
Deprecated.Parses an i18n text.- Parameters:
config- the configuration to use.pluginName- the current plugin name.name- the child name.- Returns:
- the i18n text.
- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseType
protected abstract T _parseType(Configuration parameterConfig) throws ConfigurationException
Deprecated.Parses the type.- Parameters:
parameterConfig- the parameter configuration to use.- Returns:
- the type.
- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseWidget
protected String _parseWidget(Configuration parameterConfig) throws ConfigurationException
Deprecated.Parses the widget.- Parameters:
parameterConfig- the parameter configuration to use.- Returns:
- the widget or
nullif none defined. - Throws:
ConfigurationException- if the configuration is not valid.
-
_parseWidgetParameters
protected Map<String,I18nizableText> _parseWidgetParameters(Configuration parameterConfig, String pluginName) throws ConfigurationException
Deprecated.Parses the widget's parameters- Parameters:
parameterConfig- the parameter configuration to use.pluginName- the current plugin name.- Returns:
- the widget's parameters in a Map
- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseAndSetEnumerator
protected void _parseAndSetEnumerator(String pluginName, P parameter, String parameterId, Configuration parameterConfig) throws ConfigurationException
Deprecated.Parses the enumerator.- Parameters:
pluginName- the plugin name.parameter- the parameter.parameterId- the parameter id.parameterConfig- the parameter configuration.- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseAndSetValidator
protected void _parseAndSetValidator(String pluginName, P parameter, String parameterId, Configuration parameterConfig) throws ConfigurationException
Deprecated.Parses the validator.- Parameters:
pluginName- the plugin name.parameter- the parameter.parameterId- the parameter id.parameterConfig- the parameter configuration.- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseDefaultValue
protected abstract Object _parseDefaultValue(Configuration parameterConfig, P parameter) throws ConfigurationException
Deprecated.Parses the default value.- Parameters:
parameterConfig- the parameter configuration.parameter- the parameter.- Returns:
- the default value or
nullif none defined. - Throws:
ConfigurationException- if the configuration is not valid.
-
_additionalParsing
protected void _additionalParsing(ServiceManager manager, String pluginName, Configuration parameterConfig, String parameterId, P parameter) throws ConfigurationException
Deprecated.Called for additional parsing.
Default implementation does nothing.- Parameters:
manager- the sservice manager.pluginName- the plugin name.parameterConfig- the parameter configuration.parameterId- the parameter id.parameter- the parameter to populate.- Throws:
ConfigurationException- if the configuration is not valid.
-
-