Package org.ametys.cms.model
Class AbstractElementDefinitionParser
java.lang.Object
org.ametys.runtime.model.AbstractModelItemParser
org.ametys.runtime.model.AbstractElementDefinitionParser
org.ametys.cms.model.AbstractElementDefinitionParser
- Direct Known Subclasses:
DataHolderElementDefinitionParser
,SkinParameterParser
ElementDefinition
parser from an XML configuration.-
Field Summary
Fields inherited from class org.ametys.runtime.model.AbstractModelItemParser
_disableConditionsManager, _disableConditionsToLookup, _modelItemTypeExtensionPoint
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractElementDefinitionParser
(ModelItemTypeExtensionPoint modelItemTypeExtensionPoint, ThreadSafeComponentManager<DisableConditions> disableConditionsManager, ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager) Creates an element definition parser. -
Method Summary
Modifier and TypeMethodDescriptionprotected ElementDefinition
_createModelItem
(Configuration definitionConfig) Create the model item to populate it.protected String
_parseContentTypeId
(Configuration itemConfig) Parses the content type identifier attribute.<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.AbstractElementDefinitionParser
_parseAndSetEnumerator, _parseAndSetValidator, _parseDefaultValues, lookupComponents
Methods inherited from class org.ametys.runtime.model.AbstractModelItemParser
_getNameConfigurationAttribute, _parseDisableConditions, _parseI18nizableText, _parseI18nizableText, _parseName, _parseType, _parseWidget, _parseWidgetParameters, getDisableConditionsClass, parse
-
Constructor Details
-
AbstractElementDefinitionParser
public AbstractElementDefinitionParser(ModelItemTypeExtensionPoint modelItemTypeExtensionPoint, ThreadSafeComponentManager<DisableConditions> disableConditionsManager, ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager) Creates an element definition parser.- Parameters:
modelItemTypeExtensionPoint
- the extension point to use to get available element typesdisableConditionsManager
- the disable conditions component managerenumeratorManager
- the enumerator component manager.validatorManager
- the validator component manager.
-
-
Method Details
-
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 classAbstractElementDefinitionParser
- 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 ElementDefinition _createModelItem(Configuration definitionConfig) throws ConfigurationException Description copied from class:AbstractModelItemParser
Create the model item to populate it.- Overrides:
_createModelItem
in classAbstractElementDefinitionParser
- Parameters:
definitionConfig
- the model item configuration to use.- Returns:
- the item instantiated.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_parseContentTypeId
Parses the content type identifier attribute.- Parameters:
itemConfig
- the item configuration to use.- Returns:
- the identifier of the content type or
null
if none defined. - Throws:
ConfigurationException
- if the defined content type des not exist
-