P
- the actual type of parameter.T
- the actual type of parameter type.public abstract class AbstractParameterParser<P extends Parameter<T>,T> extends Object
Parameter
parser from an XML configuration.Modifier and Type | Field and Description |
---|---|
protected ThreadSafeComponentManager<Enumerator> |
_enumeratorManager
The enumerators component manager.
|
private Map<P,String> |
_enumeratorsToLookup |
protected ThreadSafeComponentManager<Validator> |
_validatorManager
The validators component manager.
|
private Map<P,String> |
_validatorsToLookup |
Constructor and Description |
---|
AbstractParameterParser(ThreadSafeComponentManager<Enumerator> enumeratorManager,
ThreadSafeComponentManager<Validator> validatorManager)
Creates an AbstractParameterParser.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_additionalParsing(ServiceManager manager,
String pluginName,
Configuration parameterConfig,
String parameterId,
P parameter)
Called for additional parsing.
Default implementation does nothing. |
protected abstract P |
_createParameter(Configuration parameterConfig)
Create the parameter to populate it.
|
protected void |
_parseAndSetEnumerator(String pluginName,
P parameter,
String parameterId,
Configuration parameterConfig)
Parses the enumerator.
|
protected void |
_parseAndSetValidator(String pluginName,
P parameter,
String parameterId,
Configuration parameterConfig)
Parses the validator.
|
protected abstract Object |
_parseDefaultValue(Configuration parameterConfig,
P parameter)
Parses the default value.
|
protected I18nizableText |
_parseI18nizableText(Configuration config,
String pluginName,
String name)
Parses an i18n text.
|
protected abstract String |
_parseId(Configuration parameterConfig)
Parses the id.
|
protected abstract T |
_parseType(Configuration parameterConfig)
Parses the type.
|
protected String |
_parseWidget(Configuration parameterConfig)
Parses the widget.
|
protected Map<String,I18nizableText> |
_parseWidgetParameters(Configuration parameterConfig,
String pluginName)
Parses the widget's parameters
|
void |
lookupComponents()
Retrieves local validators and enumerators components and set them into
previous parameter parsed.
|
P |
parseParameter(ServiceManager manager,
String pluginName,
Configuration parameterConfig)
Parses a parameter from a XML configuration.
|
protected ThreadSafeComponentManager<Enumerator> _enumeratorManager
protected ThreadSafeComponentManager<Validator> _validatorManager
public AbstractParameterParser(ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager)
enumeratorManager
- the enumerator component manager.validatorManager
- the validator component manager.public P parseParameter(ServiceManager manager, String pluginName, Configuration parameterConfig) throws ConfigurationException
manager
- the service manager.pluginName
- the plugin name declaring this parameter.parameterConfig
- the XML configuration.ConfigurationException
- if the configuration is not valid.public void lookupComponents() throws Exception
Exception
- if an error occurs.protected abstract P _createParameter(Configuration parameterConfig) throws ConfigurationException
parameterConfig
- the parameter configuration to use.ConfigurationException
- if the configuration is not valid.protected abstract String _parseId(Configuration parameterConfig) throws ConfigurationException
parameterConfig
- the parameter configuration to use.ConfigurationException
- if the configuration is not valid.protected I18nizableText _parseI18nizableText(Configuration config, String pluginName, String name) throws ConfigurationException
config
- the configuration to use.pluginName
- the current plugin name.name
- the child name.ConfigurationException
- if the configuration is not valid.protected abstract T _parseType(Configuration parameterConfig) throws ConfigurationException
parameterConfig
- the parameter configuration to use.ConfigurationException
- if the configuration is not valid.protected String _parseWidget(Configuration parameterConfig) throws ConfigurationException
parameterConfig
- the parameter configuration to use.null
if none defined.ConfigurationException
- if the configuration is not valid.protected Map<String,I18nizableText> _parseWidgetParameters(Configuration parameterConfig, String pluginName) throws ConfigurationException
parameterConfig
- the parameter configuration to use.pluginName
- the current plugin name.ConfigurationException
- if the configuration is not valid.protected void _parseAndSetEnumerator(String pluginName, P parameter, String parameterId, Configuration parameterConfig) throws ConfigurationException
pluginName
- the plugin name.parameter
- the parameter.parameterId
- the parameter id.parameterConfig
- the parameter configuration.ConfigurationException
- if the configuration is not valid.protected void _parseAndSetValidator(String pluginName, P parameter, String parameterId, Configuration parameterConfig) throws ConfigurationException
pluginName
- the plugin name.parameter
- the parameter.parameterId
- the parameter id.parameterConfig
- the parameter configuration.ConfigurationException
- if the configuration is not valid.protected abstract Object _parseDefaultValue(Configuration parameterConfig, P parameter) throws ConfigurationException
parameterConfig
- the parameter configuration.parameter
- the parameter.null
if none defined.ConfigurationException
- if the configuration is not valid.protected void _additionalParsing(ServiceManager manager, String pluginName, Configuration parameterConfig, String parameterId, P parameter) throws ConfigurationException
manager
- the sservice manager.pluginName
- the plugin name.parameterConfig
- the parameter configuration.parameterId
- the parameter id.parameter
- the parameter to populate.ConfigurationException
- if the configuration is not valid.