|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cgiams.esl.common.util.ValidationUtil
This Singleton class provides common utility methods for validation.
Rather than providing a class with static methods, this class is a Singleton
so this class can eventually be mocked for future unit tests of other classes
which may use this functionality.
Modification History | ||
---|---|---|
Programmer | Date | Description |
Scott Bowers | 04/06/2005 | Original Author |
Field Summary | |
static java.lang.String |
DEFAULT_CLASSTYPE_MSG
Default error message if none is provided. |
static java.lang.String |
DEFAULT_ERROR_MSG
Default error message if none is provided. |
Method Summary | |
void |
checkRequiredParm(java.lang.Object ao_param)
Verifies that the incoming object is not null or blank making it a required field. |
void |
checkRequiredParm(java.lang.Object ao_param,
java.lang.String as_error_msg)
Verifies that the incoming object is not null or blank making it a required field. |
static ValidationUtil |
getInstance()
Return the Singleton instance of the ValidationUtil. |
void |
verifyParameterType(java.lang.Class ao_type,
java.lang.Object ao_parm)
Verify that the incoming parameter object's class type matches what is expected. |
void |
verifyParameterType(java.lang.Class ao_type,
java.lang.Object ao_parm,
java.lang.String as_message)
Verify that the incoming parameter object's class type matches what is expected. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_CLASSTYPE_MSG
public static final java.lang.String DEFAULT_ERROR_MSG
Method Detail |
public static ValidationUtil getInstance()
public void checkRequiredParm(java.lang.Object ao_param) throws java.lang.IllegalArgumentException
ao_param
- Any object used as a parameter.
java.lang.IllegalArgumentException
- If the incoming parameter is null or blank.public void checkRequiredParm(java.lang.Object ao_param, java.lang.String as_error_msg) throws java.lang.IllegalArgumentException
ao_param
- Any object used as a parameter.as_error_msg
- The error message to display.
java.lang.IllegalArgumentException
- If the incoming parameter is null or blank.public void verifyParameterType(java.lang.Class ao_type, java.lang.Object ao_parm)
ao_type
- The expected Class type for the parameter object.ao_parm
- The actual parameter object.public void verifyParameterType(java.lang.Class ao_type, java.lang.Object ao_parm, java.lang.String as_message)
ao_type
- The expected Class type for the parameter object.ao_parm
- The actual parameter object.as_message
- The message placed in the IllegalArgumentException.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |