Class BeanSerdeShapeResolver
java.lang.Object
io.micronaut.serde.processor.sourcegen.beans.BeanSerdeShapeResolver
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<io.micronaut.inject.ast.PropertyElement> introspectedProperties(io.micronaut.inject.ast.ClassElement element) The bean properties as the introspection resolves them.static booleanisDeserialized(io.micronaut.inject.ast.PropertyElement property) Whether the runtime object deserializer reads the property.static booleanisSerialized(io.micronaut.inject.ast.PropertyElement property) Whether the runtime object serializer writes the property.resolve(io.micronaut.inject.ast.ClassElement element)
-
Constructor Details
-
BeanSerdeShapeResolver
public BeanSerdeShapeResolver()
-
-
Method Details
-
resolve
-
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 metadataSerdeAnnotationVisitorrewrites, 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:
trueif 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:
trueif the property is deserialized
-