Class JmixKanbanSerializer

java.lang.Object
io.jmix.kanbanflowui.kit.serialization.JmixKanbanSerializer
Direct Known Subclasses:
KanbanSerializer

public class JmixKanbanSerializer extends Object
Serializer for JmixKanban's properties
  • Field Details

  • Constructor Details

    • JmixKanbanSerializer

      public JmixKanbanSerializer()
  • Method Details

    • initSerializer

      protected void initSerializer()
    • initMapper

      protected void initMapper()
    • createModule

      protected tools.jackson.databind.module.SimpleModule createModule()
    • getSerializers

      protected List<tools.jackson.databind.ser.std.StdSerializer<?>> getSerializers()
    • createFilterProvider

      protected tools.jackson.databind.ser.std.SimpleFilterProvider createFilterProvider()
    • initMapperMixIns

      protected void initMapperMixIns(tools.jackson.databind.json.JsonMapper.Builder builder)
    • serialize

      public tools.jackson.databind.JsonNode serialize(Object object)
      Serializes the passed object into JsonNode.
      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 serialized
      propertiesMapping - mapping item properties to Kanban task properties
      itemMapper - 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 serialized
      propertiesMapping - mapping item properties to Kanban task properties
      itemMapper - 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 users
      propertiesMapping - mapping item properties to Kanban task properties
      itemMapper - 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

      protected @Nullable Object convertToResource(@Nullable Object resource)
    • serializeInternal

      protected tools.jackson.databind.JsonNode serializeInternal(Object object)
    • parseRawJson

      protected tools.jackson.databind.JsonNode parseRawJson(String rawJson)
    • getAttributeValue

      protected <T> @Nullable T getAttributeValue(@Nullable Object attributeValue, Class<T> requiredClass)