public abstract class BundleWriter extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BundleWriter.FileType |
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
allowedLocales |
protected MBBundles |
bundles |
protected String |
configFile |
protected MBBundle |
currentBundle |
protected boolean |
debugMode |
protected boolean |
deleteOldFiles |
protected BundleWriter.FileType |
fileType |
protected boolean |
flexLayout |
protected List<String> |
myUsedLocales |
protected String |
outputPath |
protected boolean |
overwrite |
protected org.apache.tools.ant.Task |
task |
| Constructor and Description |
|---|
BundleWriter(org.apache.tools.ant.Task task,
String configFile,
MBBundle currentBundle,
String outputPath,
BundleWriter.FileType fileType,
Set<String> allowedLocales) |
| Modifier and Type | Method and Description |
|---|---|
protected StringBuilder |
buildOutputFileNameBase() |
protected StringBuilder |
buildOutputFileNameBase(String locale) |
protected Properties |
createProperties(String locale,
boolean merged) |
static Properties |
createProperties(String locale,
MBBundle bundle,
boolean merged,
boolean debugMode,
org.apache.tools.ant.Task task) |
protected void |
deleteFiles() |
protected void |
deleteFiles(String filePattern) |
void |
execute() |
protected MBBundle |
getCurrentBundle() |
protected String |
getFileName(String locale) |
protected String |
getFileNameFlex(String locale) |
protected String |
getFileNameJava(String locale) |
protected List<String> |
getLocalesUsed() |
protected Set<String> |
getLocalesUsed(MBBundle bundle) |
String |
getOutputPath()
the root path to store the files
|
protected String |
getOutputPathName() |
boolean |
isFlexLayout() |
protected boolean |
mkdirs(String file) |
protected boolean |
needsNewFiles()
true when generation is neccessary, false when up-to-date
|
void |
setBundles(MBBundles bundles) |
void |
setDebugMode(boolean debugMode) |
void |
setDeleteOldFiles(boolean deleteOldFiles) |
void |
setFlexLayout(boolean flexLayout) |
void |
setOverwrite(boolean overwrite) |
protected abstract String |
suffix() |
protected void |
writeOutputFilePerLocale(String locale) |
protected void |
writeOutputFiles()
generate the current bundle's property files
|
protected final org.apache.tools.ant.Task task
protected MBBundle currentBundle
protected final String configFile
protected final String outputPath
protected final BundleWriter.FileType fileType
protected boolean overwrite
protected boolean deleteOldFiles
protected boolean debugMode
protected boolean flexLayout
protected MBBundles bundles
public void setBundles(MBBundles bundles)
public void setOverwrite(boolean overwrite)
public void setDebugMode(boolean debugMode)
public void setDeleteOldFiles(boolean deleteOldFiles)
public boolean isFlexLayout()
public void setFlexLayout(boolean flexLayout)
protected boolean mkdirs(String file)
protected void writeOutputFiles()
throws Exception
Exceptionprotected void writeOutputFilePerLocale(String locale) throws Exception
Exceptionprotected void deleteFiles()
protected StringBuilder buildOutputFileNameBase()
protected StringBuilder buildOutputFileNameBase(String locale)
protected void deleteFiles(String filePattern)
protected boolean needsNewFiles()
throws FileNotFoundException
FileNotFoundExceptionprotected String getOutputPathName()
protected abstract String suffix()
public String getOutputPath()
protected List<String> getLocalesUsed()
protected MBBundle getCurrentBundle()
protected Properties createProperties(String locale, boolean merged)
locale - merged - - merged: also include properties from parent-bundles (true), only own properties (false)public static Properties createProperties(String locale, MBBundle bundle, boolean merged, boolean debugMode, org.apache.tools.ant.Task task)
Copyright © 2017. All rights reserved.