org.javalite.activejdbc
Class Messages

java.lang.Object
  extended by org.javalite.activejdbc.Messages

public class Messages
extends Object

This class is used to pull messages from a resource bundle called activejdbc_messages. It is primarily used by the validation framework, but client code can use it as well for other things.

Author:
Igor Polevoy

Constructor Summary
Messages()
           
 
Method Summary
static String message(String key, Locale locale, Object... params)
          Looks for a localized property/message in activejdbc_messages bundle.
static String message(String key, Object... params)
          Looks for a property/message in activejdbc_messages bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Messages

public Messages()
Method Detail

message

public static String message(String key,
                             Locale locale,
                             Object... params)
Looks for a localized property/message in activejdbc_messages bundle.

Parameters:
key - key of the property.
locale - locale of a bundle, or null for default locale
params - list of parameters for a message. The order of parameters in this list will correspond to the numeric order in the parameters listed in the message and has nothing to do with a physical order. This means that the first parameter in the list will correspond to {0}, second to {1} and so on.
Returns:
localized message merged with parameters (if provided), or key if message not found.

message

public static String message(String key,
                             Object... params)
Looks for a property/message in activejdbc_messages bundle.

Parameters:
key - key of the property.
params - list of substitution parameters for a message.
Returns:
message merged with parameters (if provided), or key if message not found.


Copyright © 2015 JavaLite. All rights reserved.