|
TagLib documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alweb.doff.util.error.ErrorMessage
public final class ErrorMessage
Represents an error message with optionnal parameters. ErrorMessage instances
are often created by ErrorContainer subclasses. Your model classes
can extends this class or implements ErrorProducer in order to raise
errors. Error messages can be internationalized keys or not.
ErrorContainer,
ErrorProducer| Constructor Summary | |
|---|---|
ErrorMessage(String message,
Object... params)
Constructs a new error message with the specified message as string format and optional parameters. |
|
| Method Summary | |
|---|---|
void |
addParam(Object param)
Adds specified parameter into the internal parameter list. |
void |
addParams(Collection<Object> params)
Adds specified parameters into the internal parameter list. |
void |
addParams(Object... params)
Adds specified parameters into the internal parameter list. |
boolean |
equals(Object object)
|
String |
format(ResourceBundle bundle)
Format this error message thanks to specified bundle. |
Object |
getCause()
Returns the cause of this error or null if not specified. |
String |
getMessage()
Returns the message specified at constructor. |
Collection<Object> |
getParams()
Returns a read-only collection of all parameters. |
boolean |
hasParam()
Determines if this error message has at least one parameter. |
ErrorMessage |
setCause(Object cause)
Sets the cause of this message. |
String |
toString()
Provides a string representation of this error message. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ErrorMessage(String message,
Object... params)
addParams(Object[])| Method Detail |
|---|
public void addParam(Object param)
public void addParams(Collection<Object> params)
public void addParams(Object... params)
public boolean equals(Object object)
equals in class Objectpublic String format(ResourceBundle bundle)
Format this error message thanks to specified bundle. The message is
supposed to be a key into the specified bundle. This method uses
ResourceBundle.getString(String) method and if this error message
has parameters, it formats the message thanks to
MessageFormat.format(String, Object[]) method.
If string can't be retrieved, this method doesn't throws a
MissingResourceException but returns the message surrounded with
two !.
NullPointerException - if specified bundle is null.getMessage(),
MessageFormatpublic Object getCause()
null if not specified.
getCause()public String getMessage()
public Collection<Object> getParams()
Collections.unmodifiableCollection(Collection)public boolean hasParam()
getParams(),
Collection.isEmpty()public ErrorMessage setCause(Object cause)
public String toString()
toString in class ObjectgetMessage()
|
TagLib documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||