|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.olafpanz.translationtable.CodeGenerator
final class CodeGenerator
This represents one translation table read from ots file.
| Field Summary | |
|---|---|
private TranslationDocument |
doc
Document to create source for. |
private static java.lang.String |
ENCODING
File encoding. |
private TranslationTableParameters |
param
Code creation parameters. |
private static java.util.Comparator<TranslationEntry> |
SORT_BY_TYPE_COMPARATOR
Compare translation entries by its type |
private java.util.Set<TranslationDataType> |
usedTypes
This structure is filled with types in use. |
| Constructor Summary | |
|---|---|
CodeGenerator(TranslationDocument doc,
TranslationTableParameters param)
Create a translation table with all meta information, without data. |
|
| Method Summary | |
|---|---|
private void |
create14AccessMethod(java.io.PrintWriter writer,
java.lang.String objectType,
java.lang.String dataType)
Create an access method for param.getJdk() 1.4 |
private void |
create15AccessMethod(java.io.PrintWriter writer,
TranslationDataType type,
java.lang.String dataType,
java.lang.String interfaceName)
Create an access method for param.getJdk() 1.5 |
private void |
createEmumMethods(java.io.PrintWriter writer,
TranslationDataType currType)
Create helper methods of an key-enumeration |
private java.lang.String |
createEnumInterface(java.io.File targetDir)
Create interface with keys for all translations |
void |
createFiles()
Create all necessary files. |
private java.lang.String |
createKeyInterface(java.io.File targetDir)
Create interface with keys for all translations |
private void |
createManager(java.io.File targetDir,
java.lang.String interfaceName)
Create the translation manager for the specified environment. |
private void |
createMapLocaleMethod(java.io.PrintWriter writer)
Create code that evaluates the right resource bundle. |
private void |
createPluginProperties(int localeIndex)
Do create plugin property files. |
private void |
createResourceFile(java.io.File targetDir,
int localeIndex,
java.lang.String infName)
Create resource file for one language |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String ENCODING
private final TranslationDocument doc
private final TranslationTableParameters param
private final java.util.Set<TranslationDataType> usedTypes
createKeyInterface(File)
private static final java.util.Comparator<TranslationEntry> SORT_BY_TYPE_COMPARATOR
| Constructor Detail |
|---|
public CodeGenerator(TranslationDocument doc,
TranslationTableParameters param)
doc - Document to generate code for.param - Defines how to generate code.| Method Detail |
|---|
public void createFiles()
throws java.io.IOException
java.io.IOException - Error in file creation
private final void createManager(java.io.File targetDir,
java.lang.String interfaceName)
throws java.io.IOException
targetDir - The target dirinterfaceName - Name of interface that defines keys.
java.io.IOException - Error in file creationprivate final void createMapLocaleMethod(java.io.PrintWriter writer)
(2) Search for exact match considering language, country
(3) Search for exact match considering language
(4) Use default locale
writer - Write code to this writer
private void create15AccessMethod(java.io.PrintWriter writer,
TranslationDataType type,
java.lang.String dataType,
java.lang.String interfaceName)
writer - Writer to write code totype - Type of requested elementdataType - Java data type of elementinterfaceName - Name of enum-interface
private void create14AccessMethod(java.io.PrintWriter writer,
java.lang.String objectType,
java.lang.String dataType)
writer - Writer to write source to.objectType - Name of object type, is used to create method namedataType - Name of java data type
private final java.lang.String createKeyInterface(java.io.File targetDir)
throws java.io.IOException
targetDir - Directory of target.
java.io.IOException - Writing might fail
private final java.lang.String createEnumInterface(java.io.File targetDir)
throws java.io.IOException
targetDir - Directory of target.
java.io.IOException - Writing might fail
private void createEmumMethods(java.io.PrintWriter writer,
TranslationDataType currType)
writer - Writer code to this writen; null is not allowedcurrType - Current enum type
private final void createResourceFile(java.io.File targetDir,
int localeIndex,
java.lang.String infName)
throws java.io.IOException
targetDir - Directory of target.localeIndex - Index of locale to writeinfName - Name of the created interface
java.io.IOException - Writing might fail
private void createPluginProperties(int localeIndex)
throws java.io.IOException
localeIndex - Index to the file to create.
java.io.IOException - Writing might fail
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||