org.codehaus.waffle.bind.ognl
Class OgnlBindErrorMessageResolver
java.lang.Object
org.codehaus.waffle.bind.ognl.OgnlBindErrorMessageResolver
- All Implemented Interfaces:
- BindErrorMessageResolver
public class OgnlBindErrorMessageResolver
- extends java.lang.Object
- implements BindErrorMessageResolver
Ognl-based BindErrorMessageResolver, which uses the following convention for the message resource bundles: all bind
error keys use prefix "bind.error." to which the type object it appended, eg
- "bind.error.number": a bind error for any number (short, int, float, double, long)
- "bind.error.boolean": a bind error for a boolean
- "bind.error.[type.getName()]": a bind error for the type
- "bind.error.default": any other bind error that does not satisfy any of the above
The default bind error also has a default message (cf OgnlBindErrorMessageResolver#DEFAULT_MESSAGE) if the default
key is not found.
- Author:
- Michael Ward, Mauro Talevi
Method Summary |
protected java.lang.String |
findBindErrorMessageKey(java.lang.Class<?> type)
|
java.lang.String |
resolve(java.lang.Object model,
java.lang.String propertyName,
java.lang.String value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OgnlBindErrorMessageResolver
public OgnlBindErrorMessageResolver(MessageResources messageResources)
resolve
public java.lang.String resolve(java.lang.Object model,
java.lang.String propertyName,
java.lang.String value)
- Specified by:
resolve
in interface BindErrorMessageResolver
findBindErrorMessageKey
protected java.lang.String findBindErrorMessageKey(java.lang.Class<?> type)
Copyright © 2008. All Rights Reserved.