Annotation Interface Creator


(SUBJECT TO REMOVAL) Creator methods produce instances of specific classes.

WARNING: although not deprecated (to avoid warnings that are of little use), this annotation is subject to removal, along with the API discovery tools that used it.

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.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    Order info for the listed creators of this type.
  • Element Details

    • order

      int order
      Order info for the listed creators of this type.

      The creator discovery will list creators by this value in increasing order.

      Returns:
      Expected order