com.isogen.i18nsupport
Class StaticTextDatabase

java.lang.Object
  extended bycom.isogen.i18nsupport.StaticTextDatabase

public class StaticTextDatabase
extends java.lang.Object

Manages loading static text datatabase documents. Exposes four hash tables that are then used by other classes to do lookup of translated text strings. This design reflects an initial quick refactor to pull all the text database loading code out of the I18nService class to try to make things a little cleaner. However, there is still more refactoring that could be done to improve the code.


Field Summary
 java.util.Hashtable attributeMap
           
static java.lang.String[] availableLanguages
           
 java.util.Hashtable langCodes
           
 java.util.Hashtable textAfter
           
 java.util.Hashtable textBefore
           
 
Constructor Summary
StaticTextDatabase()
           
 
Method Summary
 boolean hasKey(java.lang.String inKey, java.lang.String langCode)
          Returns true if the specified key has an entry in the database.
 void loadStaticTextDatabase(java.lang.String dbDocPath)
          Deprecated. This form of call should be replaced with the form that takes a URL as its argument. Loads the specified static text database document into the in-memory database.
 void loadStaticTextDatabase(java.net.URL dbDocUrl)
          Loads the specified static text database document into the in-memory database.
 java.lang.String printStaticTextDatabase()
          Returns a string containing a report of the in-memory translation table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textBefore

public java.util.Hashtable textBefore

textAfter

public java.util.Hashtable textAfter

attributeMap

public java.util.Hashtable attributeMap

availableLanguages

public static java.lang.String[] availableLanguages

langCodes

public java.util.Hashtable langCodes
Constructor Detail

StaticTextDatabase

public StaticTextDatabase()
Method Detail

hasKey

public boolean hasKey(java.lang.String inKey,
                      java.lang.String langCode)
               throws I18nServiceError
Returns true if the specified key has an entry in the database.

Throws:
I18nServiceError

loadStaticTextDatabase

public void loadStaticTextDatabase(java.lang.String dbDocPath)
                            throws I18nServiceError
Deprecated. This form of call should be replaced with the form that takes a URL as its argument. Loads the specified static text database document into the in-memory database.

Parameters:
dbDocPath - The system-specific path to the static text database document (e.g., static_text_database.xml).
Throws:
I18nServiceError

loadStaticTextDatabase

public void loadStaticTextDatabase(java.net.URL dbDocUrl)
                            throws I18nServiceError
Loads the specified static text database document into the in-memory database.

Parameters:
dbDocUrl - The URL of the static text database document.
Throws:
I18nServiceError

printStaticTextDatabase

public java.lang.String printStaticTextDatabase()
                                         throws I18nServiceError
Returns a string containing a report of the in-memory translation table.

Throws:
I18nServiceError