org.hdpagination.web.validate
Class ErrorMessages

java.lang.Object
  extended by org.hdpagination.web.validate.ErrorMessages

public class ErrorMessages
extends java.lang.Object

Error message collection

Since:
1.0
Author:
Liangfeng Ren

Constructor Summary
ErrorMessages()
           
 
Method Summary
 boolean addError(java.lang.String errorKey)
          Add a ErrorMessage instance, which contains only key without message, to collection
 boolean addError(java.lang.String errorKey, java.lang.String message)
          Add a ErrorMessage instance, which contains both key and message, to collection
 boolean addErrorWithoutKey(java.lang.String errorMessage)
          Add a ErrorMessage instance, which contains only message without key, to collection, This method for use in case it's not necessary to support multinational language feature to display error message.
 ErrorMessage getError(java.lang.String errorKey)
          Get stored ErrorMessage instance by key
 java.util.List getErrors()
          Return collection of ErrorMessage instance
 boolean hasErrors()
          Check if collection contains any ErrorMessage instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorMessages

public ErrorMessages()
Method Detail

getError

public ErrorMessage getError(java.lang.String errorKey)
Get stored ErrorMessage instance by key

Parameters:
errorKey -
Returns:

addError

public boolean addError(java.lang.String errorKey)
Add a ErrorMessage instance, which contains only key without message, to collection

Parameters:
errorKey -
Returns:
The returned boolean value indicates ErrorMessage is added successfully. If key already exists in collection it can not be added.

addError

public boolean addError(java.lang.String errorKey,
                        java.lang.String message)
Add a ErrorMessage instance, which contains both key and message, to collection

Parameters:
errorKey -
message -
Returns:
The returned boolean value indicates ErrorMessage is added successfully. If key already exists in collection it can not be added.

addErrorWithoutKey

public boolean addErrorWithoutKey(java.lang.String errorMessage)
Add a ErrorMessage instance, which contains only message without key, to collection, This method for use in case it's not necessary to support multinational language feature to display error message.

Parameters:
errorMessage -
Returns:

hasErrors

public boolean hasErrors()
Check if collection contains any ErrorMessage instance

Returns:

getErrors

public java.util.List getErrors()
Return collection of ErrorMessage instance

Returns:


Copyright © 2008 HDPagination All Rights Reserved.