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.UseElementDefinitionParser
insteadParameter
parser from an XML configuration.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
__LOGGER
Deprecated.protected ThreadSafeComponentManager<Enumerator>
_enumeratorManager
Deprecated.The enumerators component manager.private Map<P,String>
_enumeratorsToLookup
Deprecated.protected ThreadSafeComponentManager<Validator>
_validatorManager
Deprecated.The validators component manager.private Map<P,String>
_validatorsToLookup
Deprecated.
-
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 parametersvoid
lookupComponents()
Deprecated.Retrieves local validators and enumerators components and set them into previous parameter parsed.P
parseParameter(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
null
if 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
null
if 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.
-
-