|
soap tutorial | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectadriani.jws.template.service.ErrorMessage
public class ErrorMessage
This class is responsible for mapping all the error codes into user-friendly text messages.
In order to improve performance, all text messages are instantiated as STATIC class attributes, in this
way each text message is created only once (the first time the class is loaded).
The actual mapping between error codes and text messages is defined by some custom properties files
having the base name message_list.properties
.
Remark: the ResourceBundle.getBundle()
method retrieves the base file only
when the system Locale DOES NOT match any locale-specific file.
Example: consider a machine using an ENGLISH Locale and finding only two properties files:
message_list.properties
(base) and message_list_en.properties
(English).
In this case calling ResourceBundle.getBundle(Settings.MESSAGES, Locale.ITALY)
will load the message_list_en.properties
file because it matches the system Locale!
Hence, in order to force loading of the Italian properties, it's necessary to provide also a file
named: message_list_it.properties
.
Field Summary | |
---|---|
static int |
BAD_DATA
Output message code, depending by specific project's requirement |
static java.lang.String |
BADDATA_MESSAGE
Default value for the static field |
static int |
COMMAND
General error code (business logic level) |
static java.lang.String |
COMMAND_MESSAGE
Default value for the static field |
static int |
DAO
General error code (business logic level) |
static java.lang.String |
DATAOK_MESSAGE
Default value for the static field |
static java.lang.String |
DBA_MESSAGE
Default value for the static field |
static int |
GENERAL
General error code (business logic level) |
static java.lang.String |
GENERAL_MESSAGE
Default value for the static field |
protected static java.lang.String |
leadingName
Beginning of each logging message produced by this class. |
static int |
LOGIC
General error code (business logic level) |
static java.lang.String |
LOGIC_MESSAGE
Default value for the static field |
static int |
MACRO
General error code (business logic level) |
static java.lang.String |
MACRO_MESSAGE
Default value for the static field |
static int |
NO_CUSTOMER
Output message code, depending by specific project's requirement |
static int |
NO_DB
Database error code (DAO layer) |
static int |
NO_RECORD
Database error code (DAO layer) |
static int |
NO_RESULT
Output message code, depending by specific project's requirement |
static java.lang.String |
NOCUSTOMER_MESSAGE
Default value for the static field |
static java.lang.String |
NODB_MESSAGE
Default value for the static field |
static int |
NOK
General error code (business logic level) |
static java.lang.String |
NOK_MESSAGE
Default value for the static field |
static java.lang.String |
NORECORD_MESSAGE
Default value for the static field |
static java.lang.String |
NORESULT_MESSAGE
Default value for the static field |
static int |
OK
Output message code, depending by specific project's requirement |
static int |
SQL
Database error code (DAO layer) |
static java.lang.String |
SQL_MESSAGE
Default value for the static field |
static int |
VALIDATION
Soap specific error code |
static java.lang.String |
VALIDATION_MESSAGE
Default value for the static field |
Constructor Summary | |
---|---|
ErrorMessage()
|
Method Summary | |
---|---|
static java.lang.String |
getMessage(int code)
Return the text message mapped into the integer code as defined in the loaded properties file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NOK
public static final int DAO
public static final int MACRO
public static final int LOGIC
public static final int GENERAL
public static final int COMMAND
public static final int SQL
public static final int NO_DB
public static final int NO_RECORD
public static final int VALIDATION
public static final int OK
public static final int NO_RESULT
public static final int NO_CUSTOMER
public static final int BAD_DATA
public static java.lang.String NOK_MESSAGE
public static java.lang.String DBA_MESSAGE
public static java.lang.String MACRO_MESSAGE
public static java.lang.String LOGIC_MESSAGE
public static java.lang.String GENERAL_MESSAGE
public static java.lang.String COMMAND_MESSAGE
public static java.lang.String SQL_MESSAGE
public static java.lang.String NODB_MESSAGE
public static java.lang.String NORECORD_MESSAGE
public static java.lang.String VALIDATION_MESSAGE
public static java.lang.String DATAOK_MESSAGE
public static java.lang.String NORESULT_MESSAGE
public static java.lang.String NOCUSTOMER_MESSAGE
public static java.lang.String BADDATA_MESSAGE
protected static java.lang.String leadingName
Constructor Detail |
---|
public ErrorMessage()
Method Detail |
---|
public static java.lang.String getMessage(int code)
code
- the integer code of the error
|
Build 19/03/2014 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |