Class JmixKanbanSerializer
java.lang.Object
io.jmix.kanbanflowui.kit.serialization.JmixKanbanSerializer
- Direct Known Subclasses:
KanbanSerializer
Serializer for
JmixKanban
's properties-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final record
protected static final record
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DateFormat
static final String
static final String
static final String
protected elemental.json.impl.JreJsonFactory
protected com.fasterxml.jackson.databind.ObjectMapper
protected final DateTimeFormatter
protected final DateTimeFormatter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
convertToResource
(Object resource) protected com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider
protected com.fasterxml.jackson.databind.module.SimpleModule
protected <T> T
getAttributeValue
(Object attributeValue, Class<T> requiredClass) protected List<com.fasterxml.jackson.databind.ser.std.StdSerializer<?>>
protected void
protected void
protected void
protected <T> JmixKanbanSerializer.InternalKanbanTask
mapItemToInternalTask
(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) protected <T> JmixKanbanSerializer.InternalKanbanUser
mapItemToInternalUser
(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) protected elemental.json.JsonValue
parseRawJson
(String rawJson) elemental.json.JsonValue
Serializes the passed object intoJsonValue
.protected elemental.json.JsonValue
serializeInternal
(Object object) <T> elemental.json.JsonValue
serializeTask
(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) Serializes the passed Kanban item depends on properties mapping and item mapper.<T> elemental.json.JsonValue
serializeTasks
(Collection<T> items, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) Serializes the passed list of Kanban items depends on properties mapping and item mapper.<T> elemental.json.JsonValue
serializeUsers
(Collection<T> items, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) Collects and serializes the usernames and avatars of the passed items.
-
Field Details
-
DEFAULT_DATE_FORMAT
- See Also:
-
DEFAULT_TIME_FORMAT
- See Also:
-
DEFAULT_DATE_TIME_FORMAT
- See Also:
-
dateFormatter
-
temporalDateFormatter
-
temporalDateTimeFormatter
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
jsonFactory
protected elemental.json.impl.JreJsonFactory jsonFactory
-
-
Constructor Details
-
JmixKanbanSerializer
public JmixKanbanSerializer()
-
-
Method Details
-
initSerializer
protected void initSerializer() -
initMapper
protected void initMapper() -
createModule
protected com.fasterxml.jackson.databind.module.SimpleModule createModule() -
getSerializers
-
createFilterProvider
protected com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider createFilterProvider() -
initMapperMixIns
protected void initMapperMixIns() -
serialize
Serializes the passed object intoJsonValue
.- Parameters:
object
- object to serialize- Returns:
- serialized object
-
serializeTask
public <T> elemental.json.JsonValue serializeTask(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) Serializes the passed Kanban item depends on properties mapping and item mapper.- Type Parameters:
T
- type of the item- Parameters:
item
- item to be serializedpropertiesMapping
- mapping item properties to Kanban task propertiesitemMapper
- item properties mapper- Returns:
- serialized item
-
serializeTasks
public <T> elemental.json.JsonValue serializeTasks(Collection<T> items, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) Serializes the passed list of Kanban items depends on properties mapping and item mapper.- Type Parameters:
T
- type of the item- Parameters:
items
- items to be serializedpropertiesMapping
- mapping item properties to Kanban task propertiesitemMapper
- item properties mapper- Returns:
- serialized items
-
serializeUsers
public <T> elemental.json.JsonValue serializeUsers(Collection<T> items, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) Collects and serializes the usernames and avatars of the passed items.- Type Parameters:
T
- type of the item- Parameters:
items
- items to collecting userspropertiesMapping
- mapping item properties to Kanban task propertiesitemMapper
- item properties mapper- Returns:
- serialized collection of unique usernames and avatars of the passed items
-
mapItemToInternalTask
protected <T> JmixKanbanSerializer.InternalKanbanTask mapItemToInternalTask(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) -
mapItemToInternalUser
@Nullable protected <T> JmixKanbanSerializer.InternalKanbanUser mapItemToInternalUser(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) -
convertToResource
-
serializeInternal
-
parseRawJson
-
getAttributeValue
-