|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception org.gvsig.tools.exception.BaseException
public abstract class BaseException
Esta clase esta pensada para actuar como clase base para las excepciones que se lanzan dentro del proyecto de gvSIG. AƱade la implementacion necesaria para disponer de mensajes de error internacionalizables, a traves del metodo getLocalizedMessage, asi como una serie de metodos que nos permiten obtener los mesanes de error de la cadena de excepciones enlazadas a traves de su "causa", asi como utilidades que permitan recorrer de forma comoda esta cadena de excepciones por medio de un Iterador.
Field Summary | |
---|---|
protected long |
code
Unique code of error. |
protected String |
formatString
TODO: remove the variable, use the Exception get/setMessage() instead. |
protected String |
messageKey
|
Constructor Summary | |
---|---|
BaseException()
Deprecated. |
|
BaseException(String message,
String key,
long code)
Constructs a BaseException with a default message format, a key to find a localized message format, and a unique code to identify the exception. |
|
BaseException(String message,
Throwable cause,
String key,
long code)
Constructs a BaseException with a default message format, a key to find a localized message format, and a unique code to identify the exception. |
Method Summary | |
---|---|
long |
getCode()
|
String |
getFormatString()
|
String |
getLocalizedMessage()
Returns the translated message that describes the exception. |
String |
getLocalizedMessage(ExceptionTranslator translator,
int indent)
Returns the translated message that describes the exception with indentation. |
String |
getLocalizedMessageStack()
Crosses the exceptions chained through cause to conform the compound message in the corresponding language. |
String |
getLocalizedMessageStack(ExceptionTranslator translator,
int indent)
Crosses the exceptions chained through cause to conform the compound message in the corresponding language. |
String |
getMessage()
Returns the message that describes the exception. |
String |
getMessage(int indent)
Returns the message that describes the exception, with indentation. |
String |
getMessageKey()
|
String |
getMessageStack()
Crosses the exceptions chained through cause to conform the message. |
String |
getMessageStack(int indent)
Crosses the exceptions chained through cause to conform the compound message with indentation. |
Iterator |
iterator()
|
void |
setCode(long code)
Sets the exception's code. |
void |
setFormatString(String formatString)
Sets the format string. |
void |
setMessageKey(String messageKey)
Sets the property messageKey. |
static void |
setTranslator(ExceptionTranslator translator)
Sets the property translator. |
static void |
setTranslator(Object translator)
|
protected void |
setValue(String name,
Object value)
|
protected Map |
values()
|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, 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 |
---|
protected String messageKey
protected String formatString
protected long code
Constructor Detail |
---|
public BaseException()
public BaseException(String message, String key, long code)
message
- the default messageFormat to describe the exceptionkey
- the key to use to search a localized messageFormnatacode
- the unique code to identify the exceptionpublic BaseException(String message, Throwable cause, String key, long code)
message
- the default messageFormat to describe the exceptioncause
- the original cause of the exceptionkey
- the key to use to search a localized messageFormnatacode
- the unique code to identify the exceptionMethod Detail |
---|
public String getMessage()
IBaseException
getMessage
in interface IBaseException
getMessage
in class Throwable
public String getMessage(int indent)
IBaseException
getMessage
in interface IBaseException
indent
- Quantity of blanks to insert
at the start of the message.
public String getLocalizedMessage()
IBaseException
getLocalizedMessage
in interface IBaseException
getLocalizedMessage
in class Throwable
public String getLocalizedMessage(ExceptionTranslator translator, int indent)
IBaseException
getLocalizedMessage
in interface IBaseException
translator
- Instance of a class that fulfills
the IExceptionTranslator interface.
His method "getText" takes charge returning
the expression, correspondent to the key that
delivers him, translated into the configured language.indent
- Quantity of blanks to insert
at the start of the message.
public String getMessageStack()
IBaseException
getMessageStack
in interface IBaseException
public String getMessageStack(int indent)
IBaseException
getMessageStack
in interface IBaseException
indent
- Quantity of blanks to insert
at the start of the messages.
public String getLocalizedMessageStack()
IBaseException
getLocalizedMessageStack
in interface IBaseException
public String getLocalizedMessageStack(ExceptionTranslator translator, int indent)
IBaseException
getLocalizedMessageStack
in interface IBaseException
translator
- Instance of a class that fulfills
the IExceptionTranslator interface.
His method "getText" takes charge returning
the expression, correspondent to the key that
delivers him, translated into the configured language.indent
- Quantity of blanks to insert
at the start of the messages.
public long getCode()
getCode
in interface IBaseException
public void setCode(long code)
public String getFormatString()
getFormatString
in interface IBaseException
public void setFormatString(String formatString)
formatString
- public String getMessageKey()
getMessageKey
in interface IBaseException
public void setMessageKey(String messageKey)
messageKey
- public Iterator iterator()
iterator
in interface IBaseException
protected Map values()
protected void setValue(String name, Object value)
public static void setTranslator(ExceptionTranslator translator)
translator
- It(He,She) is used to translate the messages associated with
the exceptions.public static void setTranslator(Object translator)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |