to.etc.domui.dom.errors
Class UIMessage

java.lang.Object
  extended by to.etc.domui.dom.errors.UIMessage

public class UIMessage
extends java.lang.Object

A single error message for a component. The message consists of a message code and optional parameters, and usually hard-refers to the component where the error occured. Global errors exist also; these have a null component and must be shown in whatever error container exists.

Author:
Frits Jalvingh Created on Jun 11, 2008

Method Summary
 boolean equals(java.lang.Object obj)
           
static UIMessage error(BundleRef ref, java.lang.String code, java.lang.Object... param)
           
static UIMessage error(NodeBase node, BundleRef ref, java.lang.String code, java.lang.Object... param)
           
static UIMessage error(NodeBase node, java.lang.String errorLocation, BundleRef ref, java.lang.String code, java.lang.Object... param)
           
static UIMessage error(java.lang.String errorLocation, BundleRef ref, java.lang.String code, java.lang.Object... param)
           
static UIMessage error(UIException x)
           
 BundleRef getBundle()
          Returns the message bundle the code is in, or null if the code is a global message code (deprecated).
 java.lang.String getCode()
           
 java.lang.String getErrorLocation()
          When set this is used in error messages as an indication of which input field contains the error.
 NodeBase getErrorNode()
           
 java.lang.String getMessage()
          Returns the message part of the error message, properly localized for the request's locale.
 java.lang.Object[] getParameters()
           
 MsgType getType()
           
 int hashCode()
           
static UIMessage info(BundleRef ref, java.lang.String code, java.lang.Object... param)
           
 void setErrorLocation(java.lang.String errorLocation)
           
 void setErrorNode(NodeBase errorNode)
           
static UIMessage warning(BundleRef ref, java.lang.String code, java.lang.Object... param)
           
static UIMessage warning(NodeBase node, BundleRef ref, java.lang.String code, java.lang.Object... param)
           
static UIMessage warning(NodeBase node, java.lang.String errorLocation, BundleRef ref, java.lang.String code, java.lang.Object... param)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCode

public java.lang.String getCode()

getBundle

public BundleRef getBundle()
Returns the message bundle the code is in, or null if the code is a global message code (deprecated).

Returns:

getParameters

public java.lang.Object[] getParameters()

getErrorNode

public NodeBase getErrorNode()

setErrorNode

public void setErrorNode(NodeBase errorNode)

getType

public MsgType getType()

getErrorLocation

public java.lang.String getErrorLocation()
When set this is used in error messages as an indication of which input field contains the error. It usually contains the value for the "label" of the control.

Returns:

setErrorLocation

public void setErrorLocation(java.lang.String errorLocation)

getMessage

public java.lang.String getMessage()
Returns the message part of the error message, properly localized for the request's locale.

Returns:

error

public static UIMessage error(UIException x)

error

public static UIMessage error(NodeBase node,
                              java.lang.String errorLocation,
                              BundleRef ref,
                              java.lang.String code,
                              java.lang.Object... param)

error

public static UIMessage error(java.lang.String errorLocation,
                              BundleRef ref,
                              java.lang.String code,
                              java.lang.Object... param)

error

public static UIMessage error(NodeBase node,
                              BundleRef ref,
                              java.lang.String code,
                              java.lang.Object... param)

error

public static UIMessage error(BundleRef ref,
                              java.lang.String code,
                              java.lang.Object... param)

warning

public static UIMessage warning(NodeBase node,
                                java.lang.String errorLocation,
                                BundleRef ref,
                                java.lang.String code,
                                java.lang.Object... param)

warning

public static UIMessage warning(NodeBase node,
                                BundleRef ref,
                                java.lang.String code,
                                java.lang.Object... param)

warning

public static UIMessage warning(BundleRef ref,
                                java.lang.String code,
                                java.lang.Object... param)

info

public static UIMessage info(BundleRef ref,
                             java.lang.String code,
                             java.lang.Object... param)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object