Class SerdeSourceGenGetterMethods
java.lang.Object
io.micronaut.serde.processor.sourcegen.SerdeSourceGenGetterMethods
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 ClassesModifier and TypeClassDescriptionstatic final recordA getter method the generated serializer writes. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 booleanisSerialized(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.
-
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 typeproperties- 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 typeproperties- The introspected properties of the typeserializedPropertyNames- 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:
trueif the method is serialized
-