001package arez.annotations;
002
003import java.lang.annotation.Documented;
004import java.lang.annotation.ElementType;
005import java.lang.annotation.Target;
006
007/**
008 * Marks a template method that returns the Id of the component.
009 *
010 * <p>The method that is annotated with this annotation must also comply with the following constraints:</p>
011 * <ul>
012 * <li>Must not be annotated with any other arez annotation</li>
013 * <li>Must be abstract</li>
014 * <li>Must not throw any exceptions</li>
015 * <li>Must return a value that has the same type as returned by the method annotated by {@link ComponentId} or an <code>int</code>.</li>
016 * <li>Must be accessible to the class annotated by the {@link ArezComponent} annotation.</li>
017 * </ul>
018 *
019 * <p>This annotation is only supported on elements contained within a type annotated by
020 * {@link ArezComponent} or {@link ArezComponentLike}. Other usages will fail compilation.</p>
021 */
022@Documented
023@Target( ElementType.METHOD )
024public @interface ComponentIdRef
025{
026}