Annotation Interface ComponentTypeNameRef


Annotate the method that will be overridden to return the value of ArezComponent.name(). This is only useful when a class potentially has multiple ArezComponent annotated subclasses. This method is used when manually setting up debug context and you want it to align with the concrete implementations. However often ComponentNameRef is a better solution. If not specified Arez will generate a private method if needed.

The method that is annotated with this annotation must comply with the additional constraints:

  • Must not be annotated with any other arez annotation
  • Must have 0 parameters
  • Must return a String
  • Must be abstract
  • Must not throw exceptions
  • Must be accessible to the class annotated by the ArezComponent annotation.
  • Should not be public as not expected to be invoked outside the component. A warning will be generated but can be suppressed by the SuppressWarnings or SuppressArezWarnings annotations with a key "Arez:PublicRefMethod". This warning is also suppressed by the annotation processor if it is implementing an interface method.
  • Should not be protected if in the class annotated with the ArezComponent annotation as the method is not expected to be invoked outside the component. A warning will be generated but can be suppressed by the SuppressWarnings or SuppressArezWarnings annotations with a key "Arez:ProtectedMethod".