Interface ValueCoercible.GeneratedPropertyMembers
- Enclosing interface:
ValueCoercible
Only generated classes that need property aliases implement this contract. That keeps
the generic ValueCoercible path free of Java method/field reflection while still
preserving Python-side calls such as getName() for generated bean wrappers.
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringResolves a generated JavaBean getter method name to the Python property it should read.default booleanmicronautValueCoerciblePutMember(String key, org.graalvm.polyglot.Value value) Receives the value that was written to the wrapped Python object.default booleanmicronautValueCoercibleSetMember(String key, org.graalvm.polyglot.Value value) Gives generated wrappers a chance to handle an incoming member assignment directly.@Nullable StringResolves a generated JavaBean setter method name to the Python property it should write.
-
Method Details
-
micronautValueCoercibleGetterPropertyName
Resolves a generated JavaBean getter method name to the Python property it should read.Generated wrappers use this for aliases such as
getName()when the underlying Python object only has anameattribute.- Parameters:
key- The requested proxy member name.- Returns:
- The Python property name, or
nullwhen the member is not a generated getter alias.
-
micronautValueCoercibleSetterPropertyName
Resolves a generated JavaBean setter method name to the Python property it should write.Generated wrappers use this for aliases such as
setName(value)when the underlying Python object only has anameattribute.- Parameters:
key- The requested proxy member name.- Returns:
- The Python property name, or
nullwhen the member is not a generated setter alias.
-
micronautValueCoercibleSetMember
Gives generated wrappers a chance to handle an incoming member assignment directly.Returning
truemeans the assignment has been fully handled and the genericValueCoercible.putMember(String, Value)path must not write the member again.- Parameters:
key- The member being assigned.value- The incoming polyglot value.- Returns:
truewhen the generated wrapper consumed the assignment.
-
micronautValueCoerciblePutMember
Receives the value that was written to the wrapped Python object.Generated wrappers use this hook to keep Java-side fields and remembered async members in sync with Python-side property writes.
- Parameters:
key- The Python property or member name that was written.value- The value now stored on the wrapped Python object.- Returns:
truewhen the generated wrapper consumed the notification.
-