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 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

      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.LocaleMessageText 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.LocaleMessageText messageText)
      Add an error associated to a field with a specific message
      Parameters:
      fieldName - the fieldName (camelCase) concerned by the error
      messageText - 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