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 mounted or attached to the DOM.
009 * There must only be one method annotated with this annotation in a view.
010 * This method is invoked in the "commit" phase using reacts <code>componentDidMount()</code> lifecycle method.
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 have 0 parameters</li>
016 * <li>Must not return a value</li>
017 * <li>Must not be private</li>
018 * <li>Must not be public</li>
019 * <li>Must not be static</li>
020 * <li>Must not be abstract</li>
021 * <li>Must not throw exceptions</li>
022 * <li>Must be accessible from the same package as the class annotated by {@link View}</li>
023 * <li>
024 *   Should not be public as not expected to be invoked outside the view. A warning will be generated but can
025 *   be suppressed by the {@link SuppressWarnings} or {@link SuppressReact4jWarnings} annotations with a key
026 *   "React4j:PublicMethod". This warning is also suppressed by the annotation processor if it is implementing
027 *   an interface method.
028 * </li>
029 * <li>
030 *   Should not be protected if in the class annotated with the {@link View} annotation as the method is not
031 *   expected to be invoked outside the view. A warning will be generated but can be suppressed by the
032 *   {@link SuppressWarnings} or {@link SuppressReact4jWarnings} annotations with a key "React4j:ProtectedMethod".
033 * </li>
034 * </ul>
035 */
036@Documented
037@Target( ElementType.METHOD )
038public @interface PostMount
039{
040}