Class DtObjectErrors
java.lang.Object
io.vertigo.vega.webservice.validation.DtObjectErrors
Liste des erreurs d'un objet métier.
- Author:
- pchretien, npiedeloup
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(io.vertigo.core.locale.LocaleMessageText messageText) Add a global error on the object (for example two fields values that a not compatibles)voidAdd an error associated to a field with a specific messagevoidClears all errors.voidclearErrors(String fieldName) Clear all errors linked to a specific fieldvoidflushIntoMessageStack(String contextKey, UiMessageStack uiMessageStack) Flush all messages in the given messageStackbooleanhasError()Returns if the object has any errorbooleanReturns if a given field has errors.
-
Constructor Details
-
DtObjectErrors
public DtObjectErrors()
-
-
Method Details
-
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
Returns if a given field has errors.- Parameters:
fieldName- the fieldName (camelCase)- Returns:
- true if an error is linked to the field
-
clearErrors
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.LocaleMessageText messageText) Add a global error on the object (for example two fields values that a not compatibles)- Parameters:
messageText- the error message
-
addError
Add an error associated to a field with a specific message- Parameters:
fieldName- the fieldName (camelCase) concerned by the errormessageText- the error message
-
flushIntoMessageStack
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
-