Package io.jmix.core

Interface EntityAttributeSerializationExtension

All Known Implementing Classes:
FilterConditionAttributeSerializationExtension

public interface EntityAttributeSerializationExtension
An extension point for a mechanism to serialize and deserialize entity to JSON. The mechanism is implemented in the EntitySerialization bean.

Such beans can be useful for defining specific serialization and deserialization logic for a MetaProperty value. The supported MetaProperty is determined by the supports(MetaProperty) method.

  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(MetaProperty property, com.google.gson.JsonElement element)
    Deserializes a JSON element to meta property value.
    boolean
    Checks whether the extension supports the given meta property
    com.google.gson.JsonElement
    toJson(MetaProperty property, Object propertyValue)
    Serializes a meta property value to JSON element
  • Method Details

    • supports

      boolean supports(MetaProperty property)
      Checks whether the extension supports the given meta property
      Parameters:
      property - a meta property
      Returns:
      true if the extension supports the given meta property, or false otherwise
    • toJson

      @Nullable com.google.gson.JsonElement toJson(MetaProperty property, @Nullable Object propertyValue)
      Serializes a meta property value to JSON element
      Parameters:
      property - a meta property
      propertyValue - a meta property value
      Returns:
      a JSON element
    • fromJson

      @Nullable Object fromJson(MetaProperty property, com.google.gson.JsonElement element)
      Deserializes a JSON element to meta property value.
      Parameters:
      property - a meta property
      element - a JSON element
      Returns:
      a meta property value