001package react4j.annotations;
002
003import java.lang.annotation.Documented;
004import java.lang.annotation.ElementType;
005import java.lang.annotation.Target;
006
007/**
008 * Identifies a method that is called after a view is rendered.
009 * Render in this circumstance means that a view has been mounted on the DOM
010 * or that changes to the view have been applied to the dom.
011 * There must only be one method annotated with this annotation in a view.
012 * This method is invoked in the "commit" phase using reacts <code>componentDidUpdate()</code>
013 * and <code>componentDidMount()</code> lifecycle method.
014 *
015 * <p>The method must also conform to the following constraints:</p>
016 * <ul>
017 * <li>Must not be annotated with any other react4j annotation</li>
018 * <li>Must have 0 parameters</li>
019 * <li>Must not return a value</li>
020 * <li>Must not be private</li>
021 * <li>Must not be public</li>
022 * <li>Must not be static</li>
023 * <li>Must not be abstract</li>
024 * <li>Must not throw exceptions</li>
025 * <li>Must be accessible from the same package as the class annotated by {@link View}</li>
026 * <li>
027 *   Should not be public as not expected to be invoked outside the view. A warning will be generated but can
028 *   be suppressed by the {@link SuppressWarnings} or {@link SuppressReact4jWarnings} annotations with a key
029 *   "React4j:PublicMethod". This warning is also suppressed by the annotation processor if it is implementing
030 *   an interface method.
031 * </li>
032 * <li>
033 *   Should not be protected if in the class annotated with the {@link View} annotation as the method is not
034 *   expected to be invoked outside the view. A warning will be generated but can be suppressed by the
035 *   {@link SuppressWarnings} or {@link SuppressReact4jWarnings} annotations with a key "React4j:ProtectedMethod".
036 * </li>
037 * </ul>
038 */
039@Documented
040@Target( ElementType.METHOD )
041public @interface PostMountOrUpdate
042{
043}