org.springmodules.validation.bean.converter
Class ModelAwareMessageCodesResolver
java.lang.Object
  
org.springmodules.validation.bean.converter.ModelAwareMessageCodesResolver
- All Implemented Interfaces: 
 - Serializable, MessageCodesResolver
 
public class ModelAwareMessageCodesResolver
- extends Object
- implements MessageCodesResolver, Serializable
  
A MessageCodesResolver implementation that can be used along with the ModelAwareErrorCodeConverter.
 This resolver extracts the basic error code from the model-aware one and uses an internal message code converter to
 resolve all error codes for the this basic error code. The model-aware one is then added to the top of the error codes
 list. For example, if the internal messagee code resolver is DefaultMessageCodesResolver, the model-aware
 error code is Person.firstName[not.blank], and the basic error code is not.blank,
 then the resolved error codes will be:
 
 - Person.firstName[not.blank]
 
 - not.blank.person.firstName
 
 - not.blank.firstName
 
 - not.blank.java.lang.String
 
 - not.blank
 
 
- Author:
 
  - Uri Boness
 
- See Also:
 - Serialized Form
 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
ModelAwareMessageCodesResolver
public ModelAwareMessageCodesResolver()
- Constructs a new ModelAwareErrorCodeConverter with 
DefaultMessageCodesResolver as the internal resolver.
 
ModelAwareMessageCodesResolver
public ModelAwareMessageCodesResolver(MessageCodesResolver internalResolver)
- Constructs a new ModelAwareErrorCodeConverter with a given internal message codes resolver.
- Parameters:
 internalResolver - The internal message codes resolver to be used.
 
resolveMessageCodes
public String[] resolveMessageCodes(String errorCode,
                                    String objectName)
- Specified by:
 resolveMessageCodes in interface MessageCodesResolver
 
- See Also:
 MessageCodesResolver.resolveMessageCodes(String, String)
 
resolveMessageCodes
public String[] resolveMessageCodes(String errorCode,
                                    String objectName,
                                    String field,
                                    Class fieldType)
- Specified by:
 resolveMessageCodes in interface MessageCodesResolver
 
- See Also:
 MessageCodesResolver.resolveMessageCodes(String, String, String, Class)
 
Copyright © 2009. All Rights Reserved.