org.hibernate.validator.ap.util

## Class MessagerAdapter

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

-     public class MessagerAdapter
      extends Object

  Wrapper around `Messager`, which adds the ability to format error messages using `MessageFormat`.
  Author:
    Gunnar Morling

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MessagerAdapter(Messager messager, Diagnostic.Kind diagnosticKind)` Creates a new MessagerAdapter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Messager` | `getDelegate()` Returns the messager used by this adapter.
    `void` | `reportErrors(Set<ConstraintCheckError> errors)` Reports the given errors against the underlying `Messager` using the specified `Diagnostic.Kind`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

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

    - #### getDelegate

          public Messager getDelegate()

      Returns the messager used by this adapter.
      Returns:
        The underlying messager.

    - #### reportErrors

          public void reportErrors(Set<ConstraintCheckError> 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.

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved