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

    • DEFAULT_DATE_FORMAT

      public static final String DEFAULT_DATE_FORMAT
      See Also:
    • DEFAULT_TIME_FORMAT

      public static final String DEFAULT_TIME_FORMAT
      See Also:
    • DEFAULT_DATE_TIME_FORMAT

      public static final String DEFAULT_DATE_TIME_FORMAT
      See Also:
    • dateFormatter

      protected final DateFormat dateFormatter
    • temporalDateFormatter

      protected final DateTimeFormatter temporalDateFormatter
    • temporalDateTimeFormatter

      protected final DateTimeFormatter 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

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

      protected com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider createFilterProvider()
    • initMapperMixIns

      protected void initMapperMixIns()
    • serialize

      public elemental.json.JsonValue serialize(Object object)
      Serializes the passed object into JsonValue.
      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 serialized
      propertiesMapping - mapping item properties to Kanban task properties
      itemMapper - 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 serialized
      propertiesMapping - mapping item properties to Kanban task properties
      itemMapper - 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 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

      @Nullable protected <T> JmixKanbanSerializer.InternalKanbanUser mapItemToInternalUser(T item, JmixKanban.PropertiesMapping propertiesMapping, BiFunction<T,String,Object> itemMapper)
    • convertToResource

      protected Object convertToResource(Object resource)
    • serializeInternal

      protected elemental.json.JsonValue serializeInternal(Object object)
    • parseRawJson

      protected elemental.json.JsonValue parseRawJson(String rawJson)
    • getAttributeValue

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