Expresso 5-6

com.jcorporate.expresso.core.misc
Class ReservedWords

java.lang.Object
  extended bycom.jcorporate.expresso.core.misc.ReservedWords

public class ReservedWords
extends Object

This class is the central repository for reserved words for known/tested databases. By doublechecking against this list, you're pretty much in the clear for making sure that your field names will work in various databases.

Current sets that are checked against are:
SQL 99 Standard
Expresso Reserved Words

Author:
Michael Rimov

Field Summary
protected  TreeSet caseInsensitiveWords
          The set of case insensitive reserved words.
protected  TreeSet caseSensitiveWords
          The set of case insensitive reserved words.
protected static ReservedWords theInstance
          singleton instance.
 
Constructor Summary
protected ReservedWords()
           
 
Method Summary
protected  void buildCaseInsensitiveList()
           
protected  void buildCaseSensitiveList()
           
static ReservedWords getInstance()
          Singleton instance pattern.
 boolean isExpressoReservedWord(String testWord)
          Returns whether or not a word that shouldn't be used in web page parameters should exists
 boolean isReservedWord(String testWord)
          Returns whether a field or table name, can be used with a database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

caseInsensitiveWords

protected TreeSet caseInsensitiveWords
The set of case insensitive reserved words. These are all stored in lower case, and are usually SQL words.


caseSensitiveWords

protected TreeSet caseSensitiveWords
The set of case insensitive reserved words. Yhese usually are specific words that would interfere with the expresso framework, and thus are prohibited.


theInstance

protected static volatile ReservedWords theInstance
singleton instance. Instantiated with first call to getInstance()

Constructor Detail

ReservedWords

protected ReservedWords()
Method Detail

getInstance

public static ReservedWords getInstance()
Singleton instance pattern.


isReservedWord

public boolean isReservedWord(String testWord)
Returns whether a field or table name, can be used with a database. This does not guarantee that a DBObject will be compatibile with a database, but it does attempt to catch the most common/known errors.

Parameters:
testWord - the word to test.
Returns:
True if the would should not be used in a database.

isExpressoReservedWord

public boolean isExpressoReservedWord(String testWord)
Returns whether or not a word that shouldn't be used in web page parameters should exists


buildCaseSensitiveList

protected void buildCaseSensitiveList()

buildCaseInsensitiveList

protected void buildCaseInsensitiveList()

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.