AnnotationValues
final class AnnotationValues
Package: dev.joid.lib.utils.annotation · Module: core · Source: AnnotationValues.java
Copies the values of an annotation into the object that holds the same options, through its setters.
Description
Section titled “Description”A UI reads its @UIData... annotations into their *Object classes with it.
For each attribute of the annotation, the target needs a public method of the same name that takes the value; a nested annotation goes to the object that the method without argument returns.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
T | read(Annotation annotation, T target) static | Sets every attribute of the annotation on the target and returns it; a null annotation leaves the target unchanged. |
T | merge(T target, Annotation previous, Annotation next) static | Sets on the target only the attributes whose value differs between the previous and the next annotation, so that a change made at run time on an attribute that the annotation did not change is kept. |
Method details
Section titled “Method details”<T> T read(Annotation annotation, T target) static
Sets every attribute of the annotation on the target and returns it; a null annotation leaves the target unchanged.
Throws an IllegalStateException when the target has no method for an attribute, or when that method fails.
<T> T merge(T target, Annotation previous, Annotation next) static
Sets on the target only the attributes whose value differs between the previous and the next annotation, so that a change made at run time on an attribute that the annotation did not change is kept.
A null annotation stands for the default values; it throws an IllegalStateException like read.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
