Package org.ametys.cms.data.type.impl
Class CompositeRepositoryModelItemType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.model.type.AbstractModelItemType
org.ametys.cms.data.type.impl.CompositeRepositoryModelItemType
- All Implemented Interfaces:
RepositoryModelItemGroupType
,RepositoryModelItemType
,ModelItemGroupType
,ModelItemType
,LogEnabled
,PluginAware
public class CompositeRepositoryModelItemType
extends AbstractModelItemType
implements RepositoryModelItemGroupType
Class for composite type
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.type.RepositoryModelItemType
EMPTY_METADATA_SUFFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the type of repository data used for this typeboolean
isCompatible
(RepositoryData parentData, String name) Checks if the value in the given repository data is compatible with the item typevoid
valueToSAX
(ContentHandler contentHandler, String tagName, Object value, Optional<ViewItem> viewItem, DataContext context) Generates SAX events for the given valuevoid
valueToSAXForEdition
(ContentHandler contentHandler, String tagName, Object value, Optional<ViewItem> viewItem, DataContext context) Generates SAX events for the given value in edition mode.Methods inherited from class org.ametys.core.model.type.AbstractModelItemType
_getContextAttributes, getId, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.type.ModelItemType
getId, valueToSAX
Methods inherited from interface org.ametys.runtime.plugin.component.PluginAware
setPluginInfo
Methods inherited from interface org.ametys.plugins.repository.data.type.RepositoryModelItemGroupType
add, hasNonEmptyValue, isMultiple, read
Methods inherited from interface org.ametys.plugins.repository.data.type.RepositoryModelItemType
hasValue, remove
-
Constructor Details
-
CompositeRepositoryModelItemType
public CompositeRepositoryModelItemType()
-
-
Method Details
-
valueToSAXForEdition
public void valueToSAXForEdition(ContentHandler contentHandler, String tagName, Object value, Optional<ViewItem> viewItem, DataContext context) throws SAXException Description copied from interface:ModelItemType
Generates SAX events for the given value in edition mode. This method exist for legacy purposes because some types have to be saxed as JSON- Specified by:
valueToSAXForEdition
in interfaceModelItemType
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventstagName
- the tag name of the SAX event to generate.value
- the value to SAXviewItem
- The optional view item corresponding item that is currently saxed. This view item gives context for the SAX event that will be generated here.context
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generation
-
valueToSAX
public void valueToSAX(ContentHandler contentHandler, String tagName, Object value, Optional<ViewItem> viewItem, DataContext context) throws SAXException Description copied from interface:ModelItemType
Generates SAX events for the given value- Specified by:
valueToSAX
in interfaceModelItemType
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventstagName
- the tag name of the SAX event to generate.value
- the value to SAXviewItem
- The optional view item corresponding item that is currently saxed. This view item gives context for the SAX event that will be generated here.context
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generation
-
isCompatible
Description copied from interface:RepositoryModelItemType
Checks if the value in the given repository data is compatible with the item type- Specified by:
isCompatible
in interfaceRepositoryModelItemType
- Parameters:
parentData
- repository data containing the data to checkname
- the name of the data to check- Returns:
true
if the data type matches the current type,false
otherwise- Throws:
UnknownDataException
- if there is no data in the parent repository data with this name
-
getRepositoryDataType
Description copied from interface:RepositoryModelItemType
Retrieves the type of repository data used for this type- Specified by:
getRepositoryDataType
in interfaceRepositoryModelItemType
- Returns:
- the type of repository data used for this type
-