org.hibernate.validator.ap.util
Class MessagerAdapter

java.lang.Object
  extended by 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
MessagerAdapter(Messager messager, Diagnostic.Kind diagnosticKind)
          Creates a new MessagerAdapter.
 
Method Summary
 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-2011 Red Hat Middleware, LLC. All Rights Reserved