com.moesol.generator
Class TranslationContext

java.lang.Object
  extended by com.moesol.generator.TranslationContext

public class TranslationContext
extends Object

Provide the translation options, mappings and access to .tmpl files. The path to the translation map is given in the constructor. The class then uses the directory of the map file to find the template files.


Constructor Summary
TranslationContext(String map_path)
           
 
Method Summary
 boolean genIncludesPackage()
           
 boolean genIncludesPrivate()
           
 boolean genIncludesProtected()
           
 boolean getNoNative()
           
 boolean getNoSync()
           
 boolean getNoValues()
           
 String getPrefix()
           
 String getProperty(String key)
           
 boolean getSkipOnMissingTranslation()
           
 String getSuffix()
           
 InputStream getTmplAsStream(String name)
           
 String getTraceFinds()
           
 Properties getTranslationMap()
           
 void setGenPackage(boolean v)
           
 void setGenPrivate(boolean v)
           
 void setGenProtected(boolean v)
           
 void setMapForClass(Class c)
          Allows the mapping to be spread out over many files, one for each class.
 void setNoNative(boolean v)
           
 void setNoSync(boolean v)
           
 void setNoValues(boolean v)
           
 void setPrefix(String prefix)
          Set to override the default language search prefix For example, search for load.method instead of java.method.
 void setSkipOnMissingTranslation(boolean skip)
          Set to allow missing translations to key method skipping.
 void setSuffix(String suffix)
          Set to override the default language suffix.
 void setTraceFinds(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslationContext

public TranslationContext(String map_path)
                   throws IOException,
                          FileNotFoundException
Throws:
IOException
FileNotFoundException
Method Detail

getProperty

public String getProperty(String key)
                   throws ApplyException
Returns:
a property from the translation map
Throws:
ApplyException

getTranslationMap

public Properties getTranslationMap()
Returns:
the translation map

getTmplAsStream

public InputStream getTmplAsStream(String name)

setMapForClass

public void setMapForClass(Class c)
                    throws IOException
Allows the mapping to be spread out over many files, one for each class. Call with null to clear the class map.

Throws:
IOException

setTraceFinds

public void setTraceFinds(String name)

setPrefix

public void setPrefix(String prefix)
Set to override the default language search prefix For example, search for load.method instead of java.method.


getPrefix

public String getPrefix()

setSuffix

public void setSuffix(String suffix)
Set to override the default language suffix. e.g. Foo.java => default suffix is .java FooWriter.java => suffix is changed to Writer.java


getSuffix

public String getSuffix()

getTraceFinds

public String getTraceFinds()

setSkipOnMissingTranslation

public void setSkipOnMissingTranslation(boolean skip)
Set to allow missing translations to key method skipping.


getSkipOnMissingTranslation

public boolean getSkipOnMissingTranslation()

setGenProtected

public void setGenProtected(boolean v)

genIncludesProtected

public boolean genIncludesProtected()

setGenPackage

public void setGenPackage(boolean v)

genIncludesPackage

public boolean genIncludesPackage()

setGenPrivate

public void setGenPrivate(boolean v)

genIncludesPrivate

public boolean genIncludesPrivate()

setNoNative

public void setNoNative(boolean v)

getNoNative

public boolean getNoNative()

setNoValues

public void setNoValues(boolean v)

getNoValues

public boolean getNoValues()

setNoSync

public void setNoSync(boolean v)

getNoSync

public boolean getNoSync()


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.