Class SerdeSourceGenGetterMethods

java.lang.Object
io.micronaut.serde.processor.sourcegen.SerdeSourceGenGetterMethods

@Internal public final class SerdeSourceGenGetterMethods extends Object
Resolves the methods the runtime object serializer writes besides the bean properties.

A method annotated with @JsonGetter, or a method that is not a property accessor and is annotated with @JsonProperty, is a SerdeConfig.SerGetter bean method. The runtime serializer writes such a method after the bean properties, under its declared name or the name derived from the method name, unless a property is already written under that name.

Since:
3.2
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    A getter method the generated serializer writes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<io.micronaut.inject.ast.MethodElement>
    getterMethods(io.micronaut.inject.ast.ClassElement element, List<io.micronaut.inject.ast.PropertyElement> properties)
    The getter methods of the type in the order the introspection lists its bean methods: the executable property accessors first, followed by the other executable methods.
    static boolean
    isSerialized(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
    Whether the runtime object serializer writes a getter method.
    resolve(io.micronaut.inject.ast.ClassElement element, List<io.micronaut.inject.ast.PropertyElement> properties, Collection<String> serializedPropertyNames)
    Resolves the getter methods the runtime serializer writes after the given properties.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getterMethods

      public static List<io.micronaut.inject.ast.MethodElement> getterMethods(io.micronaut.inject.ast.ClassElement element, List<io.micronaut.inject.ast.PropertyElement> properties)
      The getter methods of the type in the order the introspection lists its bean methods: the executable property accessors first, followed by the other executable methods.
      Parameters:
      element - The type
      properties - The introspected properties of the type
      Returns:
      The getter methods, including the ones the runtime serializer does not write
    • resolve

      public static List<SerdeSourceGenGetterMethods.GetterMethod> resolve(io.micronaut.inject.ast.ClassElement element, List<io.micronaut.inject.ast.PropertyElement> properties, Collection<String> serializedPropertyNames)
      Resolves the getter methods the runtime serializer writes after the given properties.
      Parameters:
      element - The type
      properties - The introspected properties of the type
      serializedPropertyNames - The names the serialized properties are written under
      Returns:
      The written getter methods, in write order
    • isSerialized

      public static boolean isSerialized(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
      Whether the runtime object serializer writes a getter method.
      Parameters:
      annotationMetadata - The metadata of the method
      Returns:
      true if the method is serialized