Package org.ametys.cms.data.type
Interface AbstractContentElementType.Content2Json<T>
- Type Parameters:
T
- the type of the content to convert
- Enclosing class:
- AbstractContentElementType
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Convert a content (as string, ContentValue or Content) into a JSON object
-
Method Summary
Modifier and TypeMethodDescriptioncontent2Json
(T content, Optional<ViewItem> viewItem, DataContext context) Convert the given content into a JSON object
-
Method Details
-
content2Json
Convert the given content into a JSON object- Parameters:
content
- the content to convertviewItem
- The optional view item corresponding to the content that is currently converted. This view item gives context for the JSON conversion.context
- the context of the content to convert- Returns:
- the content as JSON
-