org.jpox.store
Class Dictionary

java.lang.Object
  extended byorg.jpox.store.Dictionary

public class Dictionary
extends java.lang.Object

Representation of a Dictionary to use in the generation of identifiers.

Version:
$Revision: 1.6 $

Nested Class Summary
static class Dictionary.CaseIdentifier
          Enumeration for possible cases for identifiers
 
Field Summary
static java.lang.String IDENTIFIER_CASE_PROPERTY
          PMF property name for defining the identifier case.
static java.lang.String IDENTIFIER_NAMING_STRATEGY_PROPERTY
          PMF property name for defining the identifier naming strategy.
static java.lang.String IDENTIFIER_TABLE_PREFIX_PROPERTY
          PMF property name for defining the prefix for table identifiers.
static java.lang.String IDENTIFIER_TABLE_SUFFIX_PROPERTY
          PMF property name for defining the suffic for table identifiers.
static java.lang.String IDENTIFIER_WORD_SEPARATOR_PROPERTY
          PMF property name for defining the separator for words in the identifiers.
 
Constructor Summary
Dictionary()
           
 
Method Summary
 boolean equals(java.lang.Object object)
          Equality method.
 java.lang.String getDatastoreIdentifierForJavaName(java.lang.String javaName)
          Generate a datastore identifier from a Java identifier.
static Dictionary getDefaultDictionary()
          Method to return a Dictionary using defaulted settings.
 Dictionary.CaseIdentifier getIdentifierCase()
          Accessor for the case of the identifiers.
 java.lang.String getNamingStrategy()
          Accessor for the naming strategy to use
 java.lang.String getTablePrefix()
          Accessor for the prefix for table identifiers.
 java.lang.String getTableSuffix()
          Accessor for the suffix for table identifiers.
 char getWordSeparator()
          Accessor for the word separator for identifiers.
 void setIdentifierCase(Dictionary.CaseIdentifier caseIdentifier)
          Mutator for the case of identifiers.
 void setNamingStrategy(java.lang.String namingStrategy)
          Mutator for the naming strategy to use.
 void setTablePrefix(java.lang.String tablePrefix)
          Mutator for the prefix for table identifiers
 void setTableSuffix(java.lang.String tableSuffix)
          Mutator for the suffix for table identifiers
 void setWordSeparator(java.lang.String wordSeparator)
          Mutator for the word separator identifiers
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER_NAMING_STRATEGY_PROPERTY

public static final java.lang.String IDENTIFIER_NAMING_STRATEGY_PROPERTY
PMF property name for defining the identifier naming strategy.

See Also:
Constant Field Values

IDENTIFIER_CASE_PROPERTY

public static final java.lang.String IDENTIFIER_CASE_PROPERTY
PMF property name for defining the identifier case.

See Also:
Constant Field Values

IDENTIFIER_WORD_SEPARATOR_PROPERTY

public static final java.lang.String IDENTIFIER_WORD_SEPARATOR_PROPERTY
PMF property name for defining the separator for words in the identifiers.

See Also:
Constant Field Values

IDENTIFIER_TABLE_PREFIX_PROPERTY

public static final java.lang.String IDENTIFIER_TABLE_PREFIX_PROPERTY
PMF property name for defining the prefix for table identifiers.

See Also:
Constant Field Values

IDENTIFIER_TABLE_SUFFIX_PROPERTY

public static final java.lang.String IDENTIFIER_TABLE_SUFFIX_PROPERTY
PMF property name for defining the suffic for table identifiers.

See Also:
Constant Field Values
Constructor Detail

Dictionary

public Dictionary()
Method Detail

getDefaultDictionary

public static Dictionary getDefaultDictionary()
Method to return a Dictionary using defaulted settings.

Returns:
The Dictionary

getIdentifierCase

public Dictionary.CaseIdentifier getIdentifierCase()
Accessor for the case of the identifiers.

Returns:
Returns the caseIdentifier.

setIdentifierCase

public void setIdentifierCase(Dictionary.CaseIdentifier caseIdentifier)
Mutator for the case of identifiers.

Parameters:
caseIdentifier - The caseIdentifier to set.

getTablePrefix

public java.lang.String getTablePrefix()
Accessor for the prefix for table identifiers.

Returns:
The table prefix

setTablePrefix

public void setTablePrefix(java.lang.String tablePrefix)
Mutator for the prefix for table identifiers

Parameters:
tablePrefix - The prefix for table identifiers

getTableSuffix

public java.lang.String getTableSuffix()
Accessor for the suffix for table identifiers.

Returns:
The table suffix

setTableSuffix

public void setTableSuffix(java.lang.String tableSuffix)
Mutator for the suffix for table identifiers

Parameters:
tableSuffix - The suffix for table identifiers

getWordSeparator

public char getWordSeparator()
Accessor for the word separator for identifiers.

Returns:
The word separator

setWordSeparator

public void setWordSeparator(java.lang.String wordSeparator)
Mutator for the word separator identifiers

Parameters:
wordSeparator - The word separator identifiers

getNamingStrategy

public java.lang.String getNamingStrategy()
Accessor for the naming strategy to use

Returns:
The naming strategy

setNamingStrategy

public void setNamingStrategy(java.lang.String namingStrategy)
Mutator for the naming strategy to use.

Parameters:
namingStrategy - The strategy for naming

getDatastoreIdentifierForJavaName

public java.lang.String getDatastoreIdentifierForJavaName(java.lang.String javaName)
Generate a datastore identifier from a Java identifier.

Conversion consists of breaking the identifier into words, converting each word to upper-case, and separating each one with an underscore "_". Words are identified by a leading upper-case character. Any leading or trailing underscores are removed.

Parameters:
javaName - the Java identifier.
Returns:
The datastore identifier

equals

public boolean equals(java.lang.Object object)
Equality method.

Parameters:
object - The object to compare against
Returns:
Whether they are considered equal


Copyright © -2007 . All Rights Reserved.