public class PatternMatchFunctions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CP_SYS_FLD_INVALID_EMAIL
error message when field does not contain a properly formatted email address
|
static java.lang.String |
CP_SYS_FLD_INVALID_EMPL_ID
error message when field does not contain a properly formatted employee ID
|
static java.lang.String |
NO_LD_SP
Code to check "No Leading space"
|
static java.lang.String |
NO_LDTR_SP
Code to check "No Leading or Trailing space"
|
static java.lang.String |
NO_SP
Code to check "Does not contain a space"
|
static java.lang.String |
NO_TR_SP
Code to check "No Trailing space"
|
static java.lang.String |
NOT_EQ_SP
Code to check "Not equal to space"
|
Constructor and Description |
---|
PatternMatchFunctions() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkSpace(java.lang.String value,
java.lang.String spaceCd) |
static boolean |
checkSpecialCharacter(java.lang.String value,
java.lang.String templateID)
Call this method to verify whether the template value has any special
characters.
|
static boolean |
isAlphaNumeric(java.lang.String value)
Call this method to verify whether the template value has only
alphanumeri characters.
|
static boolean |
isAlphaNumeric(java.lang.String value,
java.lang.String delimiter)
Call this method to verify whether the template value has only
alphanumeri characters with some allowed delimiters embedded in the
value
|
static boolean |
isExactMatch(java.lang.String value,
java.lang.String pattern)
Call this method to test whether the value has the same format as
the supplied pattern string
|
static void |
main(java.lang.String[] args) |
static boolean |
validateEmailAddress(java.lang.String emailAddr)
Validates a email address
|
static java.lang.String |
validateFormat(java.lang.String value,
java.lang.String formatID) |
static java.lang.String |
validateTemplate(java.lang.String value,
java.lang.String templateID,
AppInterface appI)
Call this method to validate a template.
|
public static final java.lang.String NOT_EQ_SP
public static final java.lang.String NO_LD_SP
public static final java.lang.String NO_TR_SP
public static final java.lang.String NO_LDTR_SP
public static final java.lang.String NO_SP
public static final java.lang.String CP_SYS_FLD_INVALID_EMAIL
public static final java.lang.String CP_SYS_FLD_INVALID_EMPL_ID
public static java.lang.String validateTemplate(java.lang.String value, java.lang.String templateID, AppInterface appI)
value
- The value of template fieldtemplateID
- The template ID for which validation is requestedcheckSpecialCharacter(String value,String templateID)
public static java.lang.String validateFormat(java.lang.String value, java.lang.String formatID)
public static boolean validateEmailAddress(java.lang.String emailAddr)
emailAddr
- public static boolean checkSpecialCharacter(java.lang.String value, java.lang.String templateID)
value
- The value of template fieldtemplateID
- The template for which the special character presence is testedTrue - when the value of template field does not conatin any special character other than some allowed characters for the template e.g "-" "." are allowd for some templates. Also if there is no pattern rule is defined for a template, true condition is returned
False - otherwisepublic static boolean checkSpace(java.lang.String value, java.lang.String spaceCd)
value
- The value for which space validation is to be donespaceCd
- The space validation code. The codes are
Description: Code ---------------------------------------------------- Not equal to space EQ No Leading space LD No Trailing space TR No Leading or Trailing space LDTR Does not contain a space CNT
True - when the value of field satisfies the space validation
False - otherwisepublic static boolean isAlphaNumeric(java.lang.String value)
value
- Tests whether the given string input is alphanumeric and do not have
any special charactersTrue - when the value does not contain any special character
False - otherwisepublic static boolean isAlphaNumeric(java.lang.String value, java.lang.String delimiter)
value
- Tests whether the given string input is alphanumeric and do not have
any special characters except the allowed delimiterdelimiter
- The delimiter that is permitted in the value. Currently supported
delimiters are "-" and "."True - when the value does not contain any special character other than the allowed delimiters
False - otherwisepublic static boolean isExactMatch(java.lang.String value, java.lang.String pattern)
value
- The value for pattern testingpattern
- The pattern for matchingpublic static void main(java.lang.String[] args)