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
 java.lang.String getMessage(java.lang.String key)
          Retrieves a message with the given key.
 java.lang.String substitute(java.lang.String string, java.util.Map vars)
          Performs variable substitution on the given String using variables declared in the vars Map.
 

Method Detail

getMessage

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

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

substitute

java.lang.String substitute(java.lang.String string,
                            java.util.Map vars)
                            throws java.lang.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:
java.lang.IllegalStateException - if a variable defined in the given String cannot be found in the vars Map


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