arez.annotations.ComponentNameRef Maven / Gradle / Ivy
package arez.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
/**
* Annotate the method that will be overridden to provide the "name" of the Arez component.
* This is useful when the user wants to manually create Arez elements (i.e. {@link arez.ObservableValue} instances,
* {@link arez.Observer} instances or {@link arez.ComputableValue} instances etc) and wants to use the same naming
* convention as the generated Arez subclass.
*
* The method that is annotated with the 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 {@link 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 {@link SuppressWarnings} or {@link 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 {@link 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
* {@link SuppressWarnings} or {@link SuppressArezWarnings} annotations with a key "Arez:ProtectedMethod".
*
*
*
* @see ComponentId
* @see ComponentTypeNameRef
*/
@Documented
@Target( ElementType.METHOD )
public @interface ComponentNameRef
{
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy