public class ElementDefinitionParser extends AbstractModelItemParser
ElementDefinition
parser from an XML configuration.Modifier and Type | Field and Description |
---|---|
private static Logger |
__LOGGER |
private ThreadSafeComponentManager<Enumerator> |
_enumeratorManager |
private Map<ElementDefinition,String> |
_enumeratorsToLookup |
private ThreadSafeComponentManager<Validator> |
_validatorManager |
private Map<ElementDefinition,String> |
_validatorsToLookup |
_modelItemTypeExtensionPoint
Constructor and Description |
---|
ElementDefinitionParser(AbstractThreadSafeComponentExtensionPoint<? extends ModelItemType> modelItemTypeExtensionPoint,
ThreadSafeComponentManager<Enumerator> enumeratorManager,
ThreadSafeComponentManager<Validator> validatorManager)
Creates an element definition parser.
|
Modifier and Type | Method and Description |
---|---|
protected ElementDefinition |
_createModelItem(Configuration definitionConfig)
Create the model item to populate it.
|
protected void |
_parseAndSetEnumerator(String pluginName,
ElementDefinition definition,
Configuration definitionConfig)
Parses the enumerator.
|
protected void |
_parseAndSetValidator(String pluginName,
ElementDefinition definition,
Configuration definitionConfig)
Parses the validator.
|
protected Object |
_parseDefaultValue(Configuration definitionConfig,
ElementDefinition definition)
Parses the default value.
|
protected DisableConditions |
_parseDisableConditions(Configuration definitionConfiguration)
Parses the disable condition.
|
protected Boolean |
_parseMultiple(Configuration definitionConfig)
Parses the multiple attribute.
|
protected String |
_parseWidget(Configuration definitionConfig)
Parses the widget.
|
protected Map<String,I18nizableText> |
_parseWidgetParameters(Configuration definitionConfig,
String pluginName)
Parses the widget's parameters
|
void |
lookupComponents()
Retrieves local validators and enumerators components and set them into
previous parsed element definition.
|
ElementDefinition |
parse(ServiceManager serviceManager,
String pluginName,
Configuration definitionConfig,
Model model,
ModelItemGroup parent)
Parses an element definition from a XML configuration.
|
_getNameConfigurationAttribute, _parseI18nizableText, _parseName, _parseType
private ThreadSafeComponentManager<Enumerator> _enumeratorManager
private ThreadSafeComponentManager<Validator> _validatorManager
private final Map<ElementDefinition,String> _validatorsToLookup
private final Map<ElementDefinition,String> _enumeratorsToLookup
public ElementDefinitionParser(AbstractThreadSafeComponentExtensionPoint<? extends ModelItemType> modelItemTypeExtensionPoint, ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager)
modelItemTypeExtensionPoint
- the extension point to use to get available element typesenumeratorManager
- the enumerator component manager.validatorManager
- the validator component manager.public ElementDefinition parse(ServiceManager serviceManager, String pluginName, Configuration definitionConfig, Model model, ModelItemGroup parent) throws ConfigurationException
AbstractModelItemParser
parse
in class AbstractModelItemParser
serviceManager
- the service managerpluginName
- the plugin name declaring this item.definitionConfig
- 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 parentConfigurationException
- if the configuration is not valid.protected ElementDefinition _createModelItem(Configuration definitionConfig) throws ConfigurationException
AbstractModelItemParser
_createModelItem
in class AbstractModelItemParser
definitionConfig
- the model item configuration to use.ConfigurationException
- if the configuration is not valid.protected Object _parseDefaultValue(Configuration definitionConfig, ElementDefinition definition) throws ConfigurationException
definitionConfig
- the element definition configuration.definition
- the element definition.null
if none defined.ConfigurationException
- if the configuration is not valid.protected Boolean _parseMultiple(Configuration definitionConfig) throws ConfigurationException
definitionConfig
- the element definition configuration to use.ConfigurationException
- if the configuration is not valid.protected String _parseWidget(Configuration definitionConfig) throws ConfigurationException
definitionConfig
- the element definition configuration to use.null
if none defined.ConfigurationException
- if the configuration is not valid.protected Map<String,I18nizableText> _parseWidgetParameters(Configuration definitionConfig, String pluginName) throws ConfigurationException
definitionConfig
- the parameter ele;ent definition to use.pluginName
- the current plugin name.ConfigurationException
- if the configuration is not valid.protected void _parseAndSetEnumerator(String pluginName, ElementDefinition definition, Configuration definitionConfig) throws ConfigurationException
pluginName
- the plugin name.definition
- the element definition.definitionConfig
- the element definition configuration.ConfigurationException
- if the configuration is not valid.protected void _parseAndSetValidator(String pluginName, ElementDefinition definition, Configuration definitionConfig) throws ConfigurationException
pluginName
- the plugin name.definition
- the element definition.definitionConfig
- the element definition configuration.ConfigurationException
- if the configuration is not valid.protected DisableConditions _parseDisableConditions(Configuration definitionConfiguration) throws ConfigurationException
definitionConfiguration
- the configuration of the disable conditionConfigurationException
- if an error occurredpublic void lookupComponents() throws Exception
Exception
- if an error occurs.