|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.broadleafcommerce.common.exception.TranslatableException
public abstract class TranslatableException
An exception whose message can be translated into a message suitable for a user.
| Field Summary | |
|---|---|
protected int |
code
|
| Constructor Summary | |
|---|---|
TranslatableException(int code,
String message)
Create a new exception instance |
|
| Method Summary | |
|---|---|
int |
getCode()
Retrieve the error code associated with this exception |
String |
getLocalizedMessage()
Return the message to show to the user. |
String |
toString()
Cause the message passed to the constructor to show up on stack trace logs |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int code
| Constructor Detail |
|---|
public TranslatableException(int code,
String message)
code - an integer code that represents this exception statemessage - the message that will be posted to stack traces on the console (not necessarily intended for the user)| Method Detail |
|---|
public int getCode()
public String getLocalizedMessage()
Return the message to show to the user. The framework will first look in the localized property bundles for any messages that match the supplied error code and exception type. If not found, the regular message submitted to the constructor will be returned.
Message bundle properties have the following format:
[simple class name of exception]_[integer error code]=[localized message for this exception and code]
getLocalizedMessage in class Throwablepublic String toString()
toString in class Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||