react4j.annotations.OnError Maven / Gradle / Ivy
The newest version!
package react4j.annotations;
import akasha.core.JsError;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import react4j.ReactErrorInfo;
/**
* Identifies the method that is called when a child view generates an error during rendering.
* The method works like a catch block, but for views. If this method generates an error, then this
* error will propagate to the closest OnError annotated method above it.
*
* The method can have up to two optional parameters. One is of type {@link JsError} and indicates
* the error that was thrown. The other parameter is of type {@link ReactErrorInfo} and it contains
* information about the view stack when the error was thrown.
*
* The method must also conform to the following constraints:
*
* - Must not be annotated with any other react4j annotation
* - Must not return a value
* - Must not be private
* - Must not be public
* - Must not be static
* - Must not be abstract
* - Must not throw exceptions
* - Must be accessible from the same package as the class annotated by {@link View}
* -
* Should not be public as not expected to be invoked outside the view. A warning will be generated but can
* be suppressed by the {@link SuppressWarnings} or {@link SuppressReact4jWarnings} annotations with a key
* "React4j:PublicMethod". This warning is also suppressed by the annotation processor if it is implementing
* an interface method.
*
* -
* Should not be protected if in the class annotated with the {@link View} annotation as the method is not
* expected to be invoked outside the view. A warning will be generated but can be suppressed by the
* {@link SuppressWarnings} or {@link SuppressReact4jWarnings} annotations with a key "React4j:ProtectedMethod".
*
*
*/
@Documented
@Target( ElementType.METHOD )
public @interface OnError
{
}