@Retention(value=RUNTIME) @Target(value=METHOD) @Beta @PublicAPI public @interface Creator
Consider DescriptorCalculator - DescriptorComparator relation: creation of comparators depends on the actual calculator implementation (which depends on the actual descriptor). The valid parameter classes for such creators thus can be specified only by the actual calculator implementation.
This annotation is used to mark such methods explicitly.
Note that the information carried by this annotation is implicitly already available in the actual classes, so we might eliminate it later. Currently it seems a good practice to expose this contract explicitly.
Since API discovery uses Class.getMethods()
internally the order of the listed creators - and
the order of their display - is not defined. To circumvent this problem an explicit order info is introduced.
Please note that this annotation is marked with @Beta annotation, so it can be subject of incompatible changes or removal in later releases.
Modifier and Type | Required Element and Description |
---|---|
int |
order
Order info for the listed creators of this type.
|