|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springmodules.validation.bean.converter.ModelAwareErrorCodeConverter
public class ModelAwareErrorCodeConverter
Converts simple error codes to an error code that expresses the class and perhaps the property that are associated with the error code.
| Constructor Summary | |
|---|---|
ModelAwareErrorCodeConverter()
Constructs a new ModelAwareErrorCodeConverter that uses class simple names. |
|
ModelAwareErrorCodeConverter(boolean useFullyQualifiedClassName)
Constructs a new ModelAwareErrorCodeConverter. |
|
| Method Summary | |
|---|---|
java.lang.String |
convertGlobalErrorCode(java.lang.String errorCode,
java.lang.Class clazz)
Converts the given error code to the following format: short_class_name[errorCode]
where short_class_name is the name of the given class with its package stripped, and
error_code is the given error code. |
java.lang.String |
convertPropertyErrorCode(java.lang.String errorCode,
java.lang.Class clazz,
java.lang.String propertyName)
Converts the given error code to the following format: short_class_name.property_name[errorCode]
where short_class_name is the name of the given class with its package stripped,
property_name is the given property name, and error_code is the given
error code. |
void |
setUseFullyQualifiedClassName(boolean useFullyQualifiedClassName)
Determines whether the converted error codes will use the fully qualified class names of the validated class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ModelAwareErrorCodeConverter()
error_code for class org.springmodules.validation.sample.Person will be converted
to Person[error_code].
public ModelAwareErrorCodeConverter(boolean useFullyQualifiedClassName)
error_code for
class org.springmodules.validation.sample.Person will be converted with fully qualified name set
to true, the converted error code will be
org.springmodules.validation.sample.Person[error_code].
| Method Detail |
|---|
public java.lang.String convertGlobalErrorCode(java.lang.String errorCode,
java.lang.Class clazz)
short_class_name[errorCode]
where short_class_name is the name of the given class with its package stripped, and
error_code is the given error code.
convertGlobalErrorCode in interface ErrorCodeConvertererrorCode - The given error code (the one to convert)clazz - The given class
public java.lang.String convertPropertyErrorCode(java.lang.String errorCode,
java.lang.Class clazz,
java.lang.String propertyName)
short_class_name.property_name[errorCode]
where short_class_name is the name of the given class with its package stripped,
property_name is the given property name, and error_code is the given
error code.
convertPropertyErrorCode in interface ErrorCodeConvertererrorCode - The given error code (the one to convert)clazz - The given classpropertyName - The property name
public void setUseFullyQualifiedClassName(boolean useFullyQualifiedClassName)
useFullyQualifiedClassName -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||