de.viaboxx.nlstools.formats
Class BundleWriter

java.lang.Object
  extended by de.viaboxx.nlstools.formats.BundleWriter
Direct Known Subclasses:
BundleWriterExcel, BundleWriterFlexClass, BundleWriterJavaInterface, BundleWriterJson, BundleWriterProperties, BundleWriterSql

public abstract class BundleWriter
extends Object

Description:
User: roman.stumm
Date: 15.06.2007
Time: 09:43:56
Copyright: Viaboxx GmbH


Nested Class Summary
static class BundleWriter.FileType
           
 
Field Summary
protected  Set<String> allowedLocales
           
protected  String configFile
           
protected  MBBundle currentBundle
           
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 Summary
BundleWriter(org.apache.tools.ant.Task task, String configFile, MBBundle currentBundle, String outputPath, BundleWriter.FileType fileType, Set<String> allowedLocales)
           
 
Method Summary
protected  StringBuilder buildOutputFileNameBase()
           
protected  StringBuilder buildOutputFileNameBase(String locale)
           
protected  Properties createProperties(String aLocale)
           
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()
           
 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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

task

protected final org.apache.tools.ant.Task task

currentBundle

protected final MBBundle currentBundle

configFile

protected final String configFile

outputPath

protected final String outputPath

fileType

protected final BundleWriter.FileType fileType

overwrite

protected boolean overwrite

deleteOldFiles

protected boolean deleteOldFiles

flexLayout

protected boolean flexLayout

allowedLocales

protected Set<String> allowedLocales

myUsedLocales

protected List<String> myUsedLocales
Constructor Detail

BundleWriter

public BundleWriter(org.apache.tools.ant.Task task,
                    String configFile,
                    MBBundle currentBundle,
                    String outputPath,
                    BundleWriter.FileType fileType,
                    Set<String> allowedLocales)
Method Detail

execute

public void execute()
             throws Exception
Throws:
Exception

setOverwrite

public void setOverwrite(boolean overwrite)

setDebugMode

public void setDebugMode(boolean debugMode)

setDeleteOldFiles

public void setDeleteOldFiles(boolean deleteOldFiles)

isFlexLayout

public boolean isFlexLayout()

setFlexLayout

public void setFlexLayout(boolean flexLayout)

mkdirs

protected boolean mkdirs(String file)

writeOutputFiles

protected void writeOutputFiles()
                         throws Exception
generate the current bundle's property files

Throws:
Exception

writeOutputFilePerLocale

protected void writeOutputFilePerLocale(String locale)
                                 throws Exception
Throws:
Exception

deleteFiles

protected void deleteFiles()

buildOutputFileNameBase

protected StringBuilder buildOutputFileNameBase()

buildOutputFileNameBase

protected StringBuilder buildOutputFileNameBase(String locale)

deleteFiles

protected void deleteFiles(String filePattern)

needsNewFiles

protected boolean needsNewFiles()
                         throws FileNotFoundException
true when generation is neccessary, false when up-to-date

Throws:
FileNotFoundException

getOutputPathName

protected String getOutputPathName()

getFileName

protected String getFileName(String locale)

getFileNameJava

protected String getFileNameJava(String locale)

getFileNameFlex

protected String getFileNameFlex(String locale)

suffix

protected abstract String suffix()

getOutputPath

public String getOutputPath()
the root path to store the files


getLocalesUsed

protected List<String> getLocalesUsed()
Returns:
a list of String with the locales used in the current bundle

getCurrentBundle

protected MBBundle getCurrentBundle()

createProperties

protected Properties createProperties(String aLocale)


Copyright © 2011. All Rights Reserved.