001package react4j.annotations;
002
003import java.lang.annotation.Documented;
004import java.lang.annotation.ElementType;
005import java.lang.annotation.Target;
006
007/**
008 * Identifies the method that is invoked to render the view.
009 * There must be exactly one method annotated with this annotation within the view.
010 * The method must return a value of type {@link react4j.ReactNode}.
011 *
012 * <p>The method must also conform to the following constraints:</p>
013 * <ul>
014 * <li>Must not be annotated with any other react4j annotation</li>
015 * <li>Must not be private</li>
016 * <li>Must not be static</li>
017 * <li>Must not be abstract</li>
018 * <li>Must not throw exceptions</li>
019 * <li>Must be accessible from the same package as the class annotated by {@link View}</li>
020 * <li>
021 *   Should not be public as not expected to be invoked outside the view. A warning will be generated but can
022 *   be suppressed by the {@link SuppressWarnings} or {@link SuppressReact4jWarnings} annotations with a key
023 *   "React4j:PublicMethod". This warning is also suppressed by the annotation processor if it is implementing
024 *   an interface method.
025 * </li>
026 * <li>
027 *   Should not be protected if in the class annotated with the {@link View} annotation as the method is not
028 *   expected to be invoked outside the view. A warning will be generated but can be suppressed by the
029 *   {@link SuppressWarnings} or {@link SuppressReact4jWarnings} annotations with a key "React4j:ProtectedMethod".
030 * </li>
031 * </ul>
032 */
033@Documented
034@Target( ElementType.METHOD )
035public @interface Render
036{
037}