Class MessagerAdapter

java.lang.Object
org.hibernate.validator.ap.internal.util.MessagerAdapter

public class MessagerAdapter extends Object
Wrapper around Messager, which adds the ability to format error messages using MessageFormat.
Author:
Gunnar Morling
  • Constructor Details

    • MessagerAdapter

      public MessagerAdapter(Messager messager, Diagnostic.Kind diagnosticKind)
      Creates a new MessagerAdapter.
      Parameters:
      messager - The underlying messager.
      diagnosticKind - The kind with which messages shall be reported.
  • Method Details

    • getDelegate

      public Messager getDelegate()
      Returns the messager used by this adapter.
      Returns:
      The underlying messager.
    • reportErrors

      public void reportErrors(Collection<ConstraintCheckIssue> errors)
      Reports the given errors against the underlying Messager using the specified Diagnostic.Kind.
      Parameters:
      errors - A set with errors to report. May be empty but must not be null.
    • reportWarnings

      public void reportWarnings(Collection<ConstraintCheckIssue> warnings)
      Reports the given warnings against the underlying Messager using the specified Diagnostic.Kind.
      Parameters:
      warnings - A set with errors to report. May be empty but must not be null.