Class DtObjectErrors
- java.lang.Object
-
- io.vertigo.vega.webservice.validation.DtObjectErrors
-
public final class DtObjectErrors extends Object
Liste des erreurs d'un objet métier.- Author:
- pchretien, npiedeloup
-
-
Constructor Summary
Constructors Constructor Description DtObjectErrors()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(io.vertigo.core.locale.MessageText messageText)
Add a global error on the object (for example two fields values that a not compatibles)void
addError(String fieldName, io.vertigo.core.locale.MessageText messageText)
Add an error associated to a field with a specific messagevoid
clearErrors()
Clears all errors.void
clearErrors(String fieldName)
Clear all errors linked to a specific fieldvoid
flushIntoMessageStack(String contextKey, UiMessageStack uiMessageStack)
Flush all messages in the given messageStackboolean
hasError()
Returns if the object has any errorboolean
hasError(String fieldName)
Returns if a given field has errors.
-
-
-
Method Detail
-
hasError
public boolean hasError()
Returns if the object has any error- Returns:
- true if the object has at least one error (global or field related)
-
hasError
public boolean hasError(String fieldName)
Returns if a given field has errors.- Parameters:
fieldName
- the fieldName (camelCase)- Returns:
- true if an error is linked to the field
-
clearErrors
public void clearErrors(String fieldName)
Clear all errors linked to a specific field- Parameters:
fieldName
- the fieldName (camelCase)
-
clearErrors
public void clearErrors()
Clears all errors.
-
addError
public void addError(io.vertigo.core.locale.MessageText messageText)
Add a global error on the object (for example two fields values that a not compatibles)- Parameters:
messageText
- the error message
-
addError
public void addError(String fieldName, io.vertigo.core.locale.MessageText messageText)
Add an error associated to a field with a specific message- Parameters:
fieldName
- the fieldName (camelCase) concerned by the errormessageText
- the error message
-
flushIntoMessageStack
public void flushIntoMessageStack(String contextKey, UiMessageStack uiMessageStack)
Flush all messages in the given messageStack- Parameters:
contextKey
- the key that will be associated with the error (for display)uiMessageStack
- the stack in which messages must be stored
-
-