* <p>
* @return Bundle instance
*/
- protected ResourceBundle getBundle () {
+ private ResourceBundle getBundle () {
return this.bundle;
}
* @param key Key to get message from
* @return Message
*/
- protected String getMessageStringFromKey (final String key) {
+ protected String getMessageFromKey (final String key) {
// Is the bundle loaded?
if (this.getBundle() == null) {
// Abort here
errKey = String.format("ERROR_%s_IS_NULL", field.toUpperCase()); //NOI18N
// Value it null
- facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
+ facesMessage = new FacesMessage(this.getMessageFromKey(errKey));
}
// Abort here
// Valid field?
if (!isValidField) {
// Invalid field
- facesMessage = new FacesMessage(MessageFormat.format(this.getMessageStringFromKey(errKey), clientId));
+ facesMessage = new FacesMessage(MessageFormat.format(this.getMessageFromKey(errKey), clientId));
}
// Debug message
// Compare value's type
if (!(value instanceof Boolean)) {
// Generate message
- requiredMessage = this.getMessageStringFromKey(String.format("ERROR_%s_IS_NOT_BOOLEAN", field.toUpperCase()));
+ requiredMessage = this.getMessageFromKey(String.format("ERROR_%s_IS_NOT_BOOLEAN", field.toUpperCase()));
// Value is not right type
facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); //NOI18N
// Compare value's type
if (!(value instanceof Long)) {
// Generate message
- requiredMessage = this.getMessageStringFromKey(String.format("ERROR_%s_IS_NOT_LONG", field.toUpperCase()));
+ requiredMessage = this.getMessageFromKey(String.format("ERROR_%s_IS_NOT_LONG", field.toUpperCase()));
// Value is not right type
facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); //NOI18N
// Is the number below zero?
if (num < 0) {
// Generate message
- requiredMessage = this.getMessageStringFromKey(String.format("ERROR_%s_IS_BELOW_ZERO", field.toUpperCase()));
+ requiredMessage = this.getMessageFromKey(String.format("ERROR_%s_IS_BELOW_ZERO", field.toUpperCase()));
// Abort processing here
facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage);
// Value is empty
errKey = String.format("ERROR_%s_IS_NOT_STRING", field.toUpperCase()); //NOI18N
- facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
+ facesMessage = new FacesMessage(this.getMessageFromKey(errKey));
}
// Cast to string
// Value is empty
errKey = String.format("ERROR_%s_IS_EMPTY", field.toUpperCase()); //NOI18N
- facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
+ facesMessage = new FacesMessage(this.getMessageFromKey(errKey));
}
}
}