com.bankframe.fe.statemachine.ext.validation
Class Constants

java.lang.Object
  extended bycom.bankframe.fe.statemachine.ext.validation.Constants

public final class Constants
extends java.lang.Object

This is the Constants Class. This class uses the BankframeConstant.properties to populate all it's constants.


Field Summary
static java.lang.String BANKFRAME_CONSTANTS
           
static java.lang.String DESC_SEPERATOR
           
static java.lang.String END_OF_VALUES
           
static java.lang.String LENGTH_INDICATOR
           
static java.lang.String NO_DESCRIPTION_FOUND_FOR_CODE
           
static java.lang.String PATTERN_INDICATOR
           
static java.lang.String START_OF_VALUES
           
static java.lang.String TEXT_INDICATOR
           
static java.lang.String[] VALID_TYPES
           
static java.lang.String VALUE_SEPERATOR
           
 
Constructor Summary
Constants()
           
 
Method Summary
static boolean checkForUpdates()
          This method returns the checkForUpdates value
static java.lang.String getDescriptionForValue(java.lang.String key, java.lang.Object code)
          This method will return a description for a value given the constant key.
static int getLength(java.lang.String key)
          This method gets the length for a given length key.
static java.lang.String getPattern(java.lang.String key)
          This method gets the pattern for a given pattern key.
static java.lang.String getText(java.lang.String key)
          This method gets the text for a given text key.
static java.util.Vector getValueDescriptionsList(java.lang.String key)
          This method returns a Vector containing all the constant values for a particular key
static java.lang.Object getValueForDescription(java.lang.String key, java.lang.String desc)
          This method will return a value for a description given the constant key.
static java.lang.Object getValueInList(int positionNo, java.lang.String key)
          This method returns the value in a constants list for a given key given it's position.
static java.util.Vector getValueList(java.lang.String key)
          This method returns a Vector containing all the constant values for a particular key
static boolean isAValidValue(java.lang.String key, java.lang.Object value)
          This method checks to see if a value is a valid constant value
static void main(java.lang.String[] args)
          This method runs the Constants class as an application.
static void refresh()
          This method forces a complete refresh of the constants.
static void setCheckForUpdates(boolean newCheckForUpdates)
          This method sets the checkForUpdates instance variable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BANKFRAME_CONSTANTS

public static final java.lang.String BANKFRAME_CONSTANTS
See Also:
Constant Field Values

VALID_TYPES

public static final java.lang.String[] VALID_TYPES

NO_DESCRIPTION_FOUND_FOR_CODE

public static final java.lang.String NO_DESCRIPTION_FOUND_FOR_CODE
See Also:
Constant Field Values

START_OF_VALUES

public static final java.lang.String START_OF_VALUES
See Also:
Constant Field Values

END_OF_VALUES

public static final java.lang.String END_OF_VALUES
See Also:
Constant Field Values

VALUE_SEPERATOR

public static final java.lang.String VALUE_SEPERATOR
See Also:
Constant Field Values

DESC_SEPERATOR

public static final java.lang.String DESC_SEPERATOR
See Also:
Constant Field Values

LENGTH_INDICATOR

public static final java.lang.String LENGTH_INDICATOR
See Also:
Constant Field Values

PATTERN_INDICATOR

public static final java.lang.String PATTERN_INDICATOR
See Also:
Constant Field Values

TEXT_INDICATOR

public static final java.lang.String TEXT_INDICATOR
See Also:
Constant Field Values
Constructor Detail

Constants

public Constants()
Method Detail

checkForUpdates

public static boolean checkForUpdates()
This method returns the checkForUpdates value

Returns:
boolean

getDescriptionForValue

public static java.lang.String getDescriptionForValue(java.lang.String key,
                                                      java.lang.Object code)
                                               throws ValidationException
This method will return a description for a value given the constant key. If the code has no description then throw a ValidationException

Parameters:
key - String
code - Object
Returns:
Object
Throws:
ValidationException

getLength

public static int getLength(java.lang.String key)
                     throws ValidationException
This method gets the length for a given length key.

Parameters:
key - String
Returns:
int
Throws:
ValidationException

getPattern

public static java.lang.String getPattern(java.lang.String key)
                                   throws ValidationException
This method gets the pattern for a given pattern key.

Parameters:
key - String
Returns:
String
Throws:
ValidationException

getText

public static java.lang.String getText(java.lang.String key)
                                throws ValidationException
This method gets the text for a given text key.

Parameters:
key - String
Returns:
String
Throws:
ValidationException

getValueDescriptionsList

public static java.util.Vector getValueDescriptionsList(java.lang.String key)
                                                 throws ValidationException
This method returns a Vector containing all the constant values for a particular key

Parameters:
key - String
Returns:
Vector
Throws:
ValidationException

getValueForDescription

public static java.lang.Object getValueForDescription(java.lang.String key,
                                                      java.lang.String desc)
                                               throws ValidationException
This method will return a value for a description given the constant key. If the description or code cannot be found then throw a ValidationException.

Parameters:
key - String
desc - String
Returns:
Object
Throws:
ValidationException

getValueInList

public static java.lang.Object getValueInList(int positionNo,
                                              java.lang.String key)
                                       throws ValidationException
This method returns the value in a constants list for a given key given it's position.

Parameters:
positionNo - int
key - String
Returns:
Object
Throws:
ValidationException

getValueList

public static java.util.Vector getValueList(java.lang.String key)
                                     throws ValidationException
This method returns a Vector containing all the constant values for a particular key

Parameters:
key - String
Returns:
Vector
Throws:
ValidationException

isAValidValue

public static boolean isAValidValue(java.lang.String key,
                                    java.lang.Object value)
                             throws ValidationException
This method checks to see if a value is a valid constant value

Parameters:
key - String
value - Object
Returns:
boolean true if the value is valid for the given key
Throws:
ValidationException - is thrown if the constants for the key cannot be found.

main

public static void main(java.lang.String[] args)
This method runs the Constants class as an application. It will load the constants and print them to the console. The user may then change the constants properties and reforce a reload by pressing "Enter".

Parameters:
args - java.lang.String[]

refresh

public static void refresh()
                    throws ValidationException
This method forces a complete refresh of the constants. The BankframeConstants file is re-read.

Throws:
ValidationException

setCheckForUpdates

public static void setCheckForUpdates(boolean newCheckForUpdates)
This method sets the checkForUpdates instance variable.

Parameters:
newCheckForUpdates - boolean


Copyright © 2005, 2007, Oracle. All rights reserved.