|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.dataobjects.BaseDataObject
com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
com.jcorporate.expresso.core.dbobj.DBObject
com.jcorporate.expresso.core.dbobj.SecuredDBObject
com.jcorporate.expresso.ext.dbobj.ISOCountryCodes
This database table contains a list of all known ISO 3166-1 country codes. See www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/index.html for the source of this data.
This is highly useful for registration data. Allow a person to choose from a dropdown box. Also can check postal code against known regular expressions depending on the iso country code associated with the registration.
| Nested Class Summary |
| Nested classes inherited from class com.jcorporate.expresso.core.dbobj.DBObject |
DBObject.FieldError, DBObject.FieldUpdate |
| Field Summary | |
protected static org.apache.oro.text.regex.PatternCompiler |
compiler
Used for regular expression compilation |
protected static Object |
countryCodeLock
|
protected static Reference |
countryCodes
|
static String |
FLD_COUNTRY
|
static String |
FLD_ISOCODE
|
static String |
FLD_POSTALREGEXP
|
protected static org.apache.oro.text.regex.PatternMatcher |
matcher
Used to match compiled patterns against strings |
protected static org.apache.oro.util.Cache |
regExpCache
Used to hold compiled regular expressions in an attempt to speed up pattern matching. |
static String |
TABLE
|
| Fields inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject |
ADD, ALL_FUNCTIONS, CACHE_NAME, CACHE_TTY, DELETE, SEARCH, SYSTEM_ACCOUNT, SYSTEM_ACCOUNT_NAME, UPDATE |
| Fields inherited from class com.jcorporate.expresso.core.dbobj.DBObject |
ATTRIBUTE_ERROR, ATTRIBUTE_ERROR_MESSAGE, ATTRIBUTE_PAGE_LIMIT, BIG_DECIMAL_ZERO, EMAIL_MASK, EVENT_ADD, EVENT_DELETE, EVENT_UPDATE, FLOAT_MASK, INT_MASK, IS_CHECK_RELATIONAL_INTEGRITY, UPDATE_CHANGED_ONLY, WHERE_KEYWORD |
| Fields inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject |
anyFieldsDistinct, anyFieldsToRetrieve, appendCustomWhere, caseSensitiveQuery, customWhereClause, dbKey, distinctFields, localConnection, LONGBINARY_READ_DEFAULT_SIZE, maxRecords, myClassName, myUpdates, offsetRecord, recordSet, retrieveFields, sMetadataMap, sortKeys |
| Fields inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject |
currentStatus, globalMask |
| Fields inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject |
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED |
| Constructor Summary | |
ISOCountryCodes()
Constructor |
|
ISOCountryCodes(DBConnection myConnection)
Constructor |
|
ISOCountryCodes(int uid)
Use over (String) constructor. |
|
ISOCountryCodes(RequestContext request)
For using DBObjects within Controllers. |
|
| Method Summary | |
boolean |
checkPostalCode(String testPostalCode)
Checks a postal code for proper formatting The iso country definition should already have been retrieved. |
protected static String[][] |
getCountryCodes()
|
int |
getExpectedDefaultPopulation()
Useful method for unit testing to make sure that everything got added during setup as expected. |
Vector |
getValues()
Method to return a Vector of ValidValue Template method--not implemented in this superclass. |
void |
populateDefaultValues()
This function populates the table with the current listing of ISO country codes |
protected void |
setupFields()
Method to set up the fields for this database object. |
| Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject |
add, canRequesterAdd, canRequesterDelete, canRequesterRead, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, delete, deleteAll, find, getRequestingUid, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, isAllowed, retrieve, search, searchAndRetrieveList, searchAndRetrieveList, setRequestingUid, update |
| Methods inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject |
getGlobalMask, getStatus, isGlobalMasked, setFieldsWithDefaults, setGlobalMask, setStatus |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String FLD_ISOCODE
public static final String FLD_COUNTRY
public static final String FLD_POSTALREGEXP
public static final String TABLE
protected static org.apache.oro.util.Cache regExpCache
protected static org.apache.oro.text.regex.PatternCompiler compiler
protected static org.apache.oro.text.regex.PatternMatcher matcher
protected static Reference countryCodes
protected static Object countryCodeLock
| Constructor Detail |
public ISOCountryCodes()
throws DBException
public ISOCountryCodes(DBConnection myConnection)
throws DBException
myConnection - The DBConnection to use Locally
public ISOCountryCodes(int uid)
throws DBException
uid - the Uid of the user context
DBException - if there's an initialization problem
public ISOCountryCodes(RequestContext request)
throws DBException
request - - The controller request handed to you by the framework.
DBException - if there's an initialization problem| Method Detail |
public void populateDefaultValues()
throws DBException
populateDefaultValues in class DBObjectDBException - if an error occurs while populating the table.DBObject.populateDefaultValues()public int getExpectedDefaultPopulation()
public Vector getValues()
throws DBException
DBObject
getValues in interface LookupInterfacegetValues in class DBObjectDBException - If the values cannot be retrievedDBObject.getValidValues(java.lang.String)
public boolean checkPostalCode(String testPostalCode)
throws DBException
testPostalCode - the postalCode to check
DBException - if the test code didn't match the regular expression
stored in the database OR if the regular expression in the database
is syntactically invalid
protected void setupFields()
throws DBException
DBObject
setupFields in class DBObjectDBExceptionprotected static String[][] getCountryCodes()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||