Class JmixKanbanSerializer
java.lang.Object
io.jmix.kanbanflowui.kit.serialization.JmixKanbanSerializer
- Direct Known Subclasses:
KanbanSerializer
Serializer for
JmixKanban's properties-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final recordprotected static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DateFormatstatic final Stringstatic final Stringstatic final Stringprotected elemental.json.impl.JreJsonFactoryprotected com.fasterxml.jackson.databind.ObjectMapperprotected final DateTimeFormatterprotected final DateTimeFormatter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectconvertToResource(Object resource) protected com.fasterxml.jackson.databind.ser.impl.SimpleFilterProviderprotected com.fasterxml.jackson.databind.module.SimpleModuleprotected <T> TgetAttributeValue(Object attributeValue, Class<T> requiredClass) protected List<com.fasterxml.jackson.databind.ser.std.StdSerializer<?>>protected voidprotected voidprotected voidprotected <T> JmixKanbanSerializer.InternalKanbanTaskmapItemToInternalTask(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) protected <T> JmixKanbanSerializer.InternalKanbanUsermapItemToInternalUser(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) protected elemental.json.JsonValueparseRawJson(String rawJson) elemental.json.JsonValueSerializes the passed object intoJsonValue.protected elemental.json.JsonValueserializeInternal(Object object) <T> elemental.json.JsonValueserializeTask(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.JsonValueserializeTasks(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.JsonValueserializeUsers(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
-