Class BeanSerdeShapeResolver

java.lang.Object
io.micronaut.serde.processor.sourcegen.beans.BeanSerdeShapeResolver

public final class BeanSerdeShapeResolver extends Object
Resolves bean shapes eligible for source-generated serdes.

Properties are resolved per direction the way the runtime serdes resolve them: a property is written when it is readable and not excluded from serialization, and read when it is writable and not excluded from deserialization. Writable properties excluded from deserialization are skipped silently by the generated deserializer, matching the runtime object deserializer.

  • Constructor Details

    • BeanSerdeShapeResolver

      public BeanSerdeShapeResolver()
  • Method Details

    • resolve

      public Optional<BeanSerdeShape> resolve(io.micronaut.inject.ast.ClassElement element)
    • introspectedProperties

      public static List<io.micronaut.inject.ast.PropertyElement> introspectedProperties(io.micronaut.inject.ast.ClassElement element)
      The bean properties as the introspection resolves them. The list a class element caches can be older than the metadata SerdeAnnotationVisitor rewrites, so the properties are resolved again with the query the introspection visitor uses.
      Parameters:
      element - The bean type
      Returns:
      The introspected properties
    • isSerialized

      public static boolean isSerialized(io.micronaut.inject.ast.PropertyElement property)
      Whether the runtime object serializer writes the property.
      Parameters:
      property - The property
      Returns:
      true if the property is serialized
    • isDeserialized

      public static boolean isDeserialized(io.micronaut.inject.ast.PropertyElement property)
      Whether the runtime object deserializer reads the property.
      Parameters:
      property - The property
      Returns:
      true if the property is deserialized