org.apache.tapestry.form
Class ValidationMessagesImpl

java.lang.Object
  extended by org.apache.tapestry.form.ValidationMessagesImpl
All Implemented Interfaces:
ValidationMessages
Direct Known Subclasses:
FormComponentContributorContextImpl

public class ValidationMessagesImpl
extends Object
implements ValidationMessages

Wrapper around ValidationStrings.getMessagePattern(String, Locale) and MessageFormat.format(java.lang.String, java.lang.Object[]).

Since:
4.0
Author:
Howard Lewis Ship

Constructor Summary
ValidationMessagesImpl(IFormComponent field, Locale locale)
           
 
Method Summary
 String formatValidationMessage(String messageOverride, String messageKey, Object[] arguments)
          Formats a validation message.
 Locale getLocale()
          Returns the locale for which messages are generated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationMessagesImpl

public ValidationMessagesImpl(IFormComponent field,
                              Locale locale)
Method Detail

formatValidationMessage

public String formatValidationMessage(String messageOverride,
                                      String messageKey,
                                      Object[] arguments)
Description copied from interface: ValidationMessages
Formats a validation message. Automatically chooses the correct localization.

Specified by:
formatValidationMessage in interface ValidationMessages
Parameters:
messageOverride - a supplied override to the default message format taken from the ValidationStrings.properties message catalog.
messageKey - used to look up the message format when messageOverride is blank (null or empty)
arguments - array of arguments formatted with the message format

getLocale

public Locale getLocale()
Description copied from interface: ValidationMessages
Returns the locale for which messages are generated.

Specified by:
getLocale in interface ValidationMessages


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.