Class ValidationErrors

java.lang.Object
io.jmix.flowui.component.validation.ValidationErrors

public class ValidationErrors extends Object
Describes validation errors.

To create an object of this class, use the constructor, of(String) or none() methods.

  • Field Details

  • Constructor Details

    • ValidationErrors

      public ValidationErrors()
  • Method Details

    • add

      public void add(String description)
      Add an error without reference to component causing it.
      Parameters:
      description - error description
    • add

      public void add(@Nullable com.vaadin.flow.component.Component component, String description)
      Adds an error.
      Parameters:
      component - component causing the error
      description - error description
    • add

      public void add(ValidationErrors.Item item)
      Adds an error item.
      Parameters:
      item - item to add
    • addAll

      public void addAll(ValidationErrors errors)
      Add all errors.
      Parameters:
      errors - errors
    • getAll

      public List<ValidationErrors.Item> getAll()
      Returns:
      errors list
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if there are no errors
    • getFirstComponent

      @Nullable public com.vaadin.flow.component.Component getFirstComponent()
      Returns:
      component of the first validation problem or null if no validation errors
    • of

      public static ValidationErrors of(String description)
      Creates new object with one validation error.
      Parameters:
      description - error description
      Returns:
      object with one validation error
    • none

      public static ValidationErrors none()
      Returns:
      immutable empty object