Package org.passay
Class PropertiesMessageResolver
- java.lang.Object
-
- org.passay.AbstractMessageResolver
-
- org.passay.PropertiesMessageResolver
-
- All Implemented Interfaces:
MessageResolver
public class PropertiesMessageResolver extends AbstractMessageResolver
Resolves messages from rule result details from a properties file. The default properties file is loaded from the classpath, seeDEFAULT_MESSAGE_PATH
.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_MESSAGE_PATH
Classpath location of default message map.
-
Constructor Summary
Constructors Constructor Description PropertiesMessageResolver()
Creates a new message resolver with the default message properties.PropertiesMessageResolver(Properties properties)
Creates a new message resolver with the supplied message properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Properties
getDefaultProperties()
Returns the default mapping of message keys to message strings.protected String
getMessage(String key)
Returns the message for the supplied key.-
Methods inherited from class org.passay.AbstractMessageResolver
resolve
-
-
-
-
Field Detail
-
DEFAULT_MESSAGE_PATH
public static final String DEFAULT_MESSAGE_PATH
Classpath location of default message map.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PropertiesMessageResolver
public PropertiesMessageResolver()
Creates a new message resolver with the default message properties. SeegetDefaultProperties()
.
-
PropertiesMessageResolver
public PropertiesMessageResolver(Properties properties)
Creates a new message resolver with the supplied message properties.- Parameters:
properties
- map of keys to messages.
-
-
Method Detail
-
getMessage
protected String getMessage(String key)
Description copied from class:AbstractMessageResolver
Returns the message for the supplied key.- Specified by:
getMessage
in classAbstractMessageResolver
- Parameters:
key
- which corresponds to a message- Returns:
- message
-
getDefaultProperties
public static Properties getDefaultProperties()
Returns the default mapping of message keys to message strings.- Returns:
- default message mapping.
-
-