org.gsm.oneapi.server
Class ValidationRule

java.lang.Object
  extended by org.gsm.oneapi.server.ValidationRule

public class ValidationRule
extends java.lang.Object

Internally used to assist with OneAPI server request parameter validation.

See Also:
OneAPIServlet

Field Summary
static int VALIDATION_TYPE_MANDATORY
          Require a parameter value to be supplied
static int VALIDATION_TYPE_MANDATORY_DOUBLE_GE_ZERO
          The parameter must be supplied and formatted as a number (double format) greater than or equal to zero
static int VALIDATION_TYPE_MANDATORY_DOUBLE_GT_ZERO
          The parameter must supplied and formatted as a number (double format) greater than zero
static int VALIDATION_TYPE_MANDATORY_INT_GE_ZERO
          The parameter must supplied and formatted as a number (integer format) greater than or equal to zero
static int VALIDATION_TYPE_MANDATORY_INT_GT_ONE
          The parameter must supplied and formatted as a number (integer format) greater than 1
static int VALIDATION_TYPE_MANDATORY_JSON
          The parameter must supplied and specify 'JSON'
static int VALIDATION_TYPE_MANDATORY_PAYMENT_CHANNEL
          The parameter must supplied and match one of the valid channel types ('Wap', 'Web', 'SMS')
static int VALIDATION_TYPE_MANDATORY_TEL
          The parameter must be supplied and formatted as a telephone number
static int VALIDATION_TYPE_MANDATORY_URL
          The parameter must be supplied and formatted as a URL
static int VALIDATION_TYPE_OPTIONAL
          Effectively means no validation is required
static int VALIDATION_TYPE_OPTIONAL_DOUBLE_GE_ZERO
          The parameter may be omitted but if supplied must have a (double) value greater than or equal to zero
static int VALIDATION_TYPE_OPTIONAL_DOUBLE_GT_ZERO
          The parameter may be omitted but if supplied must have a (double) value greater than zero
static int VALIDATION_TYPE_OPTIONAL_INT_GE_ZERO
          The parameter may be omitted but if supplied must have an (integer) value greater than or equal to zero
static int VALIDATION_TYPE_OPTIONAL_INT_GT_ONE
          The parameter may be omitted but if supplied must have an (integer) value greater than 1
static int VALIDATION_TYPE_OPTIONAL_JSON
          The parameter may be omitted but if supplied must match the string 'JSON'
static int VALIDATION_TYPE_OPTIONAL_PAYMENT_CHANNEL
          The parameter may be omitted but if supplied must match one of the valid channel types ('Wap', 'Web', 'SMS')
static int VALIDATION_TYPE_OPTIONAL_TEL
          The parameter may be omitted but if supplied must be in a correct telephone number format
static int VALIDATION_TYPE_OPTIONAL_URL
          The parameter may be omitted but if supplied must be in a correct URL format
 
Constructor Summary
ValidationRule(int validationType, java.lang.String parameterName, java.lang.Object parameterValue)
          Normal constructor where specific value matching is not required
ValidationRule(int validationType, java.lang.String parameterName, java.lang.Object parameterValue, java.lang.String specificValue)
          Extended constructor where specific value matching is required
 
Method Summary
static boolean isMandatory(int type)
          Identifies which validation types are mandatory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATION_TYPE_OPTIONAL

public static final int VALIDATION_TYPE_OPTIONAL
Effectively means no validation is required

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY

public static final int VALIDATION_TYPE_MANDATORY
Require a parameter value to be supplied

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY_DOUBLE_GT_ZERO

public static final int VALIDATION_TYPE_MANDATORY_DOUBLE_GT_ZERO
The parameter must supplied and formatted as a number (double format) greater than zero

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY_DOUBLE_GE_ZERO

public static final int VALIDATION_TYPE_MANDATORY_DOUBLE_GE_ZERO
The parameter must be supplied and formatted as a number (double format) greater than or equal to zero

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY_TEL

public static final int VALIDATION_TYPE_MANDATORY_TEL
The parameter must be supplied and formatted as a telephone number

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY_URL

public static final int VALIDATION_TYPE_MANDATORY_URL
The parameter must be supplied and formatted as a URL

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY_INT_GE_ZERO

public static final int VALIDATION_TYPE_MANDATORY_INT_GE_ZERO
The parameter must supplied and formatted as a number (integer format) greater than or equal to zero

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY_INT_GT_ONE

public static final int VALIDATION_TYPE_MANDATORY_INT_GT_ONE
The parameter must supplied and formatted as a number (integer format) greater than 1

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY_JSON

public static final int VALIDATION_TYPE_MANDATORY_JSON
The parameter must supplied and specify 'JSON'

See Also:
Constant Field Values

VALIDATION_TYPE_MANDATORY_PAYMENT_CHANNEL

public static final int VALIDATION_TYPE_MANDATORY_PAYMENT_CHANNEL
The parameter must supplied and match one of the valid channel types ('Wap', 'Web', 'SMS')

See Also:
Constant Field Values

VALIDATION_TYPE_OPTIONAL_DOUBLE_GT_ZERO

public static final int VALIDATION_TYPE_OPTIONAL_DOUBLE_GT_ZERO
The parameter may be omitted but if supplied must have a (double) value greater than zero

See Also:
Constant Field Values

VALIDATION_TYPE_OPTIONAL_DOUBLE_GE_ZERO

public static final int VALIDATION_TYPE_OPTIONAL_DOUBLE_GE_ZERO
The parameter may be omitted but if supplied must have a (double) value greater than or equal to zero

See Also:
Constant Field Values

VALIDATION_TYPE_OPTIONAL_TEL

public static final int VALIDATION_TYPE_OPTIONAL_TEL
The parameter may be omitted but if supplied must be in a correct telephone number format

See Also:
Constant Field Values

VALIDATION_TYPE_OPTIONAL_URL

public static final int VALIDATION_TYPE_OPTIONAL_URL
The parameter may be omitted but if supplied must be in a correct URL format

See Also:
Constant Field Values

VALIDATION_TYPE_OPTIONAL_INT_GE_ZERO

public static final int VALIDATION_TYPE_OPTIONAL_INT_GE_ZERO
The parameter may be omitted but if supplied must have an (integer) value greater than or equal to zero

See Also:
Constant Field Values

VALIDATION_TYPE_OPTIONAL_INT_GT_ONE

public static final int VALIDATION_TYPE_OPTIONAL_INT_GT_ONE
The parameter may be omitted but if supplied must have an (integer) value greater than 1

See Also:
Constant Field Values

VALIDATION_TYPE_OPTIONAL_JSON

public static final int VALIDATION_TYPE_OPTIONAL_JSON
The parameter may be omitted but if supplied must match the string 'JSON'

See Also:
Constant Field Values

VALIDATION_TYPE_OPTIONAL_PAYMENT_CHANNEL

public static final int VALIDATION_TYPE_OPTIONAL_PAYMENT_CHANNEL
The parameter may be omitted but if supplied must match one of the valid channel types ('Wap', 'Web', 'SMS')

See Also:
Constant Field Values
Constructor Detail

ValidationRule

public ValidationRule(int validationType,
                      java.lang.String parameterName,
                      java.lang.Object parameterValue)
Normal constructor where specific value matching is not required

Parameters:
validationType -
parameterName -
parameterValue -

ValidationRule

public ValidationRule(int validationType,
                      java.lang.String parameterName,
                      java.lang.Object parameterValue,
                      java.lang.String specificValue)
Extended constructor where specific value matching is required

Parameters:
validationType -
parameterName -
parameterValue -
specificValue -
Method Detail

isMandatory

public static boolean isMandatory(int type)
Identifies which validation types are mandatory

Parameters:
type -