Package org.ametys.runtime.model.type
Interface ModelItemType
- All Superinterfaces:
PluginAware
- All Known Subinterfaces:
ComplexRepositoryElementType<T>
,ElementType<T>
,IndexableElementType<T>
,IndexableModelItemType
,ModelItemGroupType
,RepositoryElementType<T>
,RepositoryModelItemGroupType
,RepositoryModelItemType
,SortableIndexableElementType<T>
,XMLElementType<T>
,XSLElementType<T>
- All Known Implementing Classes:
AbstractBinaryElementType
,AbstractBooleanElementType
,AbstractContentElementType
,AbstractDateElementType
,AbstractDateTimeElementType
,AbstractDoubleElementType
,AbstractElementType
,AbstractFileElementType
,AbstractGeocodeElementType
,AbstractLongElementType
,AbstractMatrixElementType
,AbstractModelItemType
,AbstractMultilingualStringElementType
,AbstractReferenceElementType
,AbstractResourceReferenceElementType
,AbstractRichTextElementType
,AbstractRuleElementType
,AbstractStringElementType
,AbstractUserElementType
,BinaryIndexableElementType
,BinaryRepositoryElementType
,BooleanIndexableElementType
,BooleanRepositoryElementType
,BooleanXMLElementType
,BooleanXSLElementType
,CompositeRepositoryModelItemType
,ContentContentElementType
,ContentIndexableElementType
,ContentRepositoryElementType
,DateIndexableElementType
,DateRepositoryElementType
,DateTimeIndexableElementType
,DateTimeRepositoryElementType
,DateTimeXMLElementType
,DateXMLElementType
,DoubleIndexableElementType
,DoubleRepositoryElementType
,DoubleXMLElementType
,DoubleXSLElementType
,FileContentElementType
,FileIndexableElementType
,FileRepositoryElementType
,GeocodeIndexableElementType
,GeocodeRepositoryElementType
,HTMLRichTextContentElementType
,HTMLRichTextRepositoryElementType
,LongIndexableElementType
,LongRepositoryElementType
,LongXMLElementType
,LongXSLElementType
,MatrixRepositoryElementType
,MultilingualStringIndexableElementType
,MultilingualStringRepositoryElementType
,PasswordRepositoryElementType
,PasswordXMLElementType
,ReferenceContentElementType
,ReferenceIndexableElementType
,ReferenceRepositoryElementType
,RepeaterRepositoryModelItemType
,ResourceReferenceRepositoryElementType
,RichTextContentElementType
,RichTextIndexableElementType
,RichTextRepositoryElementType
,RuleRepositoryElementType
,StringIndexableElementType
,StringRepositoryElementType
,StringXMLElementType
,StringXSLElementType
,UserIndexableElementType
,UserRepositoryElementType
Interface for model item types
-
Method Summary
Modifier and TypeMethodDescriptiongetId()
Retrieves the identifier of the parameter typevalueToJSONForClient
(Object value, Optional<ViewItem> viewItem, DataContext context) Convert the value into a JSON object to use client sidedefault Object
valueToJSONForClient
(Object value, DataContext context) Convert the value into a JSON object to use client sidevalueToJSONForEdition
(Object value, Optional<ViewItem> viewItem, DataContext context) Convert the value into a JSON object to use in edition modevoid
valueToSAX
(ContentHandler contentHandler, String tagName, Object value, Optional<ViewItem> viewItem, DataContext context) Generates SAX events for the given valuedefault void
valueToSAX
(ContentHandler contentHandler, String tagName, Object value, 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 interface org.ametys.runtime.plugin.component.PluginAware
setPluginInfo
-
Method Details
-
getId
Retrieves the identifier of the parameter type- Returns:
- the identifier of the parameter type
-
valueToSAX
default void valueToSAX(ContentHandler contentHandler, String tagName, Object value, DataContext context) throws SAXException Generates SAX events for the given value- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventstagName
- the tag name of the SAX event to generate.value
- the value to SAXcontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generation
-
valueToSAXForEdition
void valueToSAXForEdition(ContentHandler contentHandler, String tagName, Object value, Optional<ViewItem> viewItem, DataContext context) throws SAXException 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- 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
void valueToSAX(ContentHandler contentHandler, String tagName, Object value, Optional<ViewItem> viewItem, DataContext context) throws SAXException Generates SAX events for the given value- 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
-
valueToJSONForClient
Convert the value into a JSON object to use client side- Parameters:
value
- the value to convertcontext
- The context of the data to convert. Can not be null.- Returns:
- The value as JSON
-
valueToJSONForEdition
Convert the value into a JSON object to use in edition mode- Parameters:
value
- the value to convertviewItem
- The optional view item corresponding item that is currently converted. This view item gives context for the JSON conversion.context
- The context of the data to convert. Can not be null.- Returns:
- The value as JSON
-
valueToJSONForClient
Convert the value into a JSON object to use client side- Parameters:
value
- the value to convertviewItem
- The optional view item corresponding item that is currently converted. This view item gives context for the JSON conversion.context
- The context of the data to convert. Can not be null.- Returns:
- The value as JSON
-