package es.sandbox.ui.messages;

import es.sandbox.ui.messages.resolver.MessageResolverStrategy;


/**
 * <p>
 * Allow controllers to add flash messages in the view.
 * </p>
 * <p>
 * Some examples:
 * <p>
 * <pre>
 * flash.success(&quot;i18n.message.code&quot;);
 * flash.error(&quot;i18n.message.code&quot;,
 *              1L, new Date());
 * flash.warning(&quot;i18n.message.code&quot;,
 *              Arguments.text(&quot;i18n.argument.code&quot;));
 * flash.info(&quot;i18n.message.code&quot;,
 *              Arguments.link(&quot;/path/to/somewhere&quot;).title(&quot;i18n.argument.code&quot;));
 * </pre>
 *
 * @author jeslopalo
 * @since v0.1
 */
public interface Flash {

    /**
     * Flash a new <b>success message</b>. It will be resolved
     * using the configured {@link MessageResolverStrategy}
     *
     * @param code
     * @param arguments
     * @throws NullPointerException
     * @throws IllegalArgumentException
     */
    void success(String code, Object... arguments)
        throws NullPointerException, IllegalArgumentException;

    /**
     * Flash a new <b>info message</b>. It will be resolved
     * using the configured {@link MessageResolverStrategy}
     *
     * @param code
     * @param arguments
     * @throws NullPointerException
     * @throws IllegalArgumentException
     */
    void info(String code, Object... arguments)
        throws NullPointerException, IllegalArgumentException;

    /**
     * Flash a new <b>warning message</b>. It will be resolved
     * using the configured {@link MessageResolverStrategy}
     *
     * @param code
     * @param arguments
     * @throws NullPointerException
     * @throws IllegalArgumentException
     */
    void warning(String code, Object... arguments)
        throws NullPointerException, IllegalArgumentException;

    /**
     * Flash a new <b>error message</b>. It will be resolved
     * using the configured {@link MessageResolverStrategy}
     *
     * @param code
     * @param arguments
     * @throws NullPointerException
     * @throws IllegalArgumentException
     */
    void error(String code, Object... arguments)
        throws NullPointerException, IllegalArgumentException;

    /**
     * Clear all messages from all {@link Level}s
     */
    void clear();

    /**
     * Check whether there are no messages
     *
     * @return
     */
    boolean isEmpty();
}

@@ -96,23 +96,16 @@
 ;%0A%0A%0A/**%0A
- * %3Cp%3E%0A
  * Allow
@@ -156,23 +156,8 @@
 ew.%0A
- * %3C/p%3E%0A * %3Cp%3E%0A
  * S
@@ -174,15 +174,8 @@
 es:%0A
- * %3Cp%3E%0A
  * %3C

Fix javadoc for Flash