Package org.apache.empire.commons
Class ErrorType
java.lang.Object
org.apache.empire.commons.ErrorType
The ErrorType class defines a type of error.
In order to define an error you need to provide an ErrorKey and a MessagePattern.
The ErrorKey is a unique identifier for the error that may also be used as a translation key The ErrorKey should always start with the "error." prefix.
The MessagePattern is a template containing the error message and placeholders for additional parameters.
The MessagePattern must be formated according to the MessageFormat rules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKey()Returns the error type key (might be used for internationalization).Returns the message pattern.intReturns the number of parameters required for the message pattern.
-
Constructor Details
-
ErrorType
Defines an error type.- Parameters:
errorKey- the error key string (can be used for internationalization)msgPattern- message pattern in english language used e.g. for logging
-
-
Method Details
-
getKey
Returns the error type key (might be used for internationalization).- Returns:
- the error type key
-
getMessagePattern
Returns the message pattern.- Returns:
- the message pattern
-
getNumParams
public int getNumParams()Returns the number of parameters required for the message pattern.- Returns:
- the number of parameters required for the message pattern
-