org.apache.wicket.validation
Interface IErrorMessageSource


public interface IErrorMessageSource

Interface representing a message source that stores messages by key and can perform variable substitution.

Since:
1.2.6
Author:
Igor Vaynberg (ivaynberg)

Method Summary
 String getMessage(String key)
          Retrieves a message with the given key.
 String substitute(String string, Map<String,Object> vars)
          Performs variable substitution on the given String using variables declared in the vars Map.
 

Method Detail

getMessage

String getMessage(String key)
Retrieves a message with the given key.

Parameters:
key - a message key
Returns:
message or null if not found

substitute

String substitute(String string,
                  Map<String,Object> vars)
                  throws IllegalStateException
Performs variable substitution on the given String using variables declared in the vars Map.

Variables in the message are identified using ${varname} syntax.

Parameters:
string - a String to be altered
vars - a Map of variables to process
Returns:
the given String with the variables substituted
Throws:
IllegalStateException - if a variable defined in the given String cannot be found in the vars Map


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.