net.firstpartners.rp.common.exception
Class RpException

java.lang.Object
  extended by java.lang.Throwable
      extended by net.firstpartners.rp.common.exception.RpException
All Implemented Interfaces:
java.io.Serializable

public class RpException
extends java.lang.Throwable

RP specific exception

Author:
brownpa
See Also:
Serialized Form

Field Summary
private  java.lang.String code
          key to error text found in messages.properties file
private  java.lang.Object[] values
          Object array that will be used if there are any variables in the error text
 
Constructor Summary
RpException(java.lang.String p_code)
          Creates a new RpException object.
RpException(java.lang.String code, java.lang.Object[] values)
          Creates a new RpException object.
 
Method Summary
 java.lang.String getMessage()
          Return the string of the message, in case that the message code not exists the message will SYSTEM:No such code
 java.lang.String getMessage(java.lang.String defaultMessage)
          Return the string of the message, in case that the message code not exists the default message will be used
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code

private java.lang.String code
key to error text found in messages.properties file


values

private java.lang.Object[] values
Object array that will be used if there are any variables in the error text

Constructor Detail

RpException

public RpException(java.lang.String code,
                   java.lang.Object[] values)
Creates a new RpException object.

Parameters:
code - Code of the exception
values - List of the attributes values

RpException

public RpException(java.lang.String p_code)
Creates a new RpException object.

Parameters:
p_code - Code of exception
Method Detail

getMessage

public java.lang.String getMessage(java.lang.String defaultMessage)
Return the string of the message, in case that the message code not exists the default message will be used

Parameters:
defaultMessage - Used to generate the message
Returns:
Return the message using the base property files

getMessage

public java.lang.String getMessage()
Return the string of the message, in case that the message code not exists the message will SYSTEM:No such code

Overrides:
getMessage in class java.lang.Throwable
Returns:
Return the message using the base property files