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 tools.jackson.databind.ObjectMapperprotected final DateTimeFormatterprotected final DateTimeFormatter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable ObjectconvertToResource(@Nullable Object resource) protected tools.jackson.databind.ser.std.SimpleFilterProviderprotected tools.jackson.databind.module.SimpleModuleprotected <T> @Nullable TgetAttributeValue(@Nullable Object attributeValue, Class<T> requiredClass) protected List<tools.jackson.databind.ser.std.StdSerializer<?>> protected voidprotected voidinitMapperMixIns(tools.jackson.databind.json.JsonMapper.Builder builder) protected voidprotected <T> JmixKanbanSerializer.InternalKanbanTaskmapItemToInternalTask(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) protected <T> @Nullable JmixKanbanSerializer.InternalKanbanUsermapItemToInternalUser(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) protected tools.jackson.databind.JsonNodeparseRawJson(String rawJson) tools.jackson.databind.JsonNodeSerializes the passed object intoJsonNode.protected tools.jackson.databind.JsonNodeserializeInternal(Object object) <T> tools.jackson.databind.JsonNodeserializeTask(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) Serializes the passed Kanban item depends on properties mapping and item mapper.<T> tools.jackson.databind.JsonNodeserializeTasks(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> tools.jackson.databind.JsonNodeserializeUsers(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 tools.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
JmixKanbanSerializer
public JmixKanbanSerializer()
-
-
Method Details
-
initSerializer
protected void initSerializer() -
initMapper
protected void initMapper() -
createModule
protected tools.jackson.databind.module.SimpleModule createModule() -
getSerializers
-
createFilterProvider
protected tools.jackson.databind.ser.std.SimpleFilterProvider createFilterProvider() -
initMapperMixIns
protected void initMapperMixIns(tools.jackson.databind.json.JsonMapper.Builder builder) -
serialize
Serializes the passed object intoJsonNode.- Parameters:
object- object to serialize- Returns:
- serialized object
-
serializeTask
public <T> tools.jackson.databind.JsonNode 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> tools.jackson.databind.JsonNode 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> tools.jackson.databind.JsonNode 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
protected <T> @Nullable JmixKanbanSerializer.InternalKanbanUser mapItemToInternalUser(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T, String, Object> itemMapper) -
convertToResource
-
serializeInternal
-
parseRawJson
-
getAttributeValue
-