com.wrq.apptrieve.agent
Class ErrorMessage

java.lang.Object
  extended by com.wrq.apptrieve.agent.ErrorMessage

public class ErrorMessage
extends java.lang.Object

Describes a single runtime error. An ErrorMessage has an error code, zero or more parameters, generic error text, and localized error text. Error parameters can either be objects of type java.lang.String or java.lang.Integer. Objects of this type are immutable.

To create an ErrorMessage object in an event handler, use the appropriate com.wrq.vhi.script.api.Event.createErrorMessage method.


Field Summary
static int USER_GENERIC
           
 
Constructor Summary
ErrorMessage(int code, java.lang.Object[] params, java.lang.String mesg, java.lang.String localizedMesg)
          Construct an ErrorMessage.
ErrorMessage(int code, java.lang.String mesg, java.lang.String localizedMesg)
          Construct an ErrorMessage.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object with this error message for equality.
 int getErrorCode()
          Return the error code.
 java.lang.String getLocalizedText()
          Get a localized textual description of the error.
 java.lang.Object getParameter(int index)
          Get a specific parameter.
 int getParameterCount()
          Get the number of parameters in this error message.
 java.lang.String getText()
          Get a textual description of the error.
 int hashCode()
          Returns the hash code value for this error message.
 java.lang.String toString()
          Returns a textual description of the error.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

USER_GENERIC

public static final int USER_GENERIC
Constructor Detail

ErrorMessage

public ErrorMessage(int code,
                    java.lang.String mesg,
                    java.lang.String localizedMesg)
Construct an ErrorMessage.

Parameters:
code - error code
mesg - generic message text
localizedMesg - localized message text

ErrorMessage

public ErrorMessage(int code,
                    java.lang.Object[] params,
                    java.lang.String mesg,
                    java.lang.String localizedMesg)
Construct an ErrorMessage.

Parameters:
code - error code
params - message parameters
mesg - generic message text
localizedMesg - localized message text
Method Detail

getErrorCode

public int getErrorCode()
Return the error code.

Returns:
code representing error condition

getText

public java.lang.String getText()
Get a textual description of the error.

Returns:
error text

getLocalizedText

public java.lang.String getLocalizedText()
Get a localized textual description of the error.

Returns:
localized error text

getParameterCount

public int getParameterCount()
Get the number of parameters in this error message.

Returns:
number of parameters

getParameter

public java.lang.Object getParameter(int index)
Get a specific parameter.

Parameters:
index - parameter index
Returns:
error parameter as java.lang.String or java.lang.Integer

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this error message for equality. Returns true if and only if the specified object is also an ErrorMessage; both ErrorMessages have the same error code, text, and localized text; and all corresponding parameters in the two parameter object arrays are equal.

Overrides:
equals in class java.lang.Object
Parameters:
o - compare this object for equality
Returns:
true if the specified object is equal

hashCode

public int hashCode()
Returns the hash code value for this error message. The hash code calculation uses the error code and error message text.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code for this object

toString

public java.lang.String toString()
Returns a textual description of the error.

Overrides:
toString in class java.lang.Object
Returns:
the text of this error message