Package org.ametys.cms.model
Class ElementDefinitionParser
java.lang.Object
org.ametys.runtime.model.AbstractModelItemParser
org.ametys.runtime.model.ElementDefinitionParser
org.ametys.cms.model.ElementDefinitionParser
- Direct Known Subclasses:
 ContentAttributeDefinitionParser,ServiceParameterDefinitionParser,SiteParameterParser,SkinParameterParser,SynchronizableContentsCollectionModelParameterParser,ViewParameterDefinitionParser
ElementDefinition parser from an XML configuration.- 
Field Summary
Fields inherited from class org.ametys.runtime.model.AbstractModelItemParser
_modelItemTypeExtensionPoint - 
Constructor Summary
ConstructorsConstructorDescriptionElementDefinitionParser(ModelItemTypeExtensionPoint modelItemTypeExtensionPoint, 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.ElementDefinitionParser
_parseAndSetEnumerator, _parseAndSetValidator, _parseDefaultValue, _parseDefaultValues, _parseMultiple, lookupComponentsMethods inherited from class org.ametys.runtime.model.AbstractModelItemParser
_getNameConfigurationAttribute, _parseConditions, _parseDisableConditions, _parseI18nizableText, _parseI18nizableText, _parseName, _parseType, _parseWidget, _parseWidgetParameters, parse 
- 
Constructor Details
- 
ElementDefinitionParser
public ElementDefinitionParser(ModelItemTypeExtensionPoint modelItemTypeExtensionPoint, ThreadSafeComponentManager<Enumerator> enumeratorManager, ThreadSafeComponentManager<Validator> validatorManager) Creates an element definition parser.- Parameters:
 modelItemTypeExtensionPoint- the extension point to use to get available element typesenumeratorManager- 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:AbstractModelItemParserParses an element definition from a XML configuration.- Overrides:
 parsein classElementDefinitionParser- 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:AbstractModelItemParserCreate the model item to populate it.- Overrides:
 _createModelItemin classElementDefinitionParser- 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 
nullif none defined. - Throws:
 ConfigurationException- if the defined content type des not exist
 
 -