arez.annotations.CascadeDispose Maven / Gradle / Ivy
package arez.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
/**
* Methods and fields annotated by this annotation should be disposed when the component is disposed.
* The dispose occurs after the {@link PreDispose} method.
*
* It should be noted that it is preferable for the field that defines the contained component is marked
* with this annotation rather than the method accessor. The reason is that the annotation processor
* will issue a warning if a field that the processor identifies as a potential contained component if it is
* not annotated with {@link ComponentDependency} or {@link CascadeDispose}.
*
* If the element annotated is a method then the method must comply with the additional constraints:
*
* - Must not be annotated with any other arez annotation other than {@link Reference} or {@link Observable}
* - Must have 0 parameters
* - The type of the field must implement {@link arez.Disposable} or must be annotated by {@link ArezComponent}
* - Must not be private
* - Must not be static
* - Must not be abstract unless the method is annotated with {@link Reference} or {@link Observable} in which case it MUST be abstract
* - Must not throw exceptions
* - Must be accessible to the class annotated by the {@link ArezComponent} annotation.
*
*
* If the element annotated is a field then the field must comply with the additional constraints:
*
* - Must not be private
* - Must not be static
* - The type of the field must implement {@link arez.Disposable} or must be annotated by {@link ArezComponent}
* - The field must be accessible to the component subclass which means it must be protected or package access if it is in the same package as the arez component.
*
*/
@Documented
@Target( { ElementType.METHOD, ElementType.FIELD } )
public @interface CascadeDispose
{
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy