|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.jomc.tools.JomcTool
org.jomc.tools.JavaBundles
public class JavaBundles
Generates Java bundles.
Use cases
writeBundleResources(java.io.File)writeBundleResources(org.jomc.model.Module, java.io.File)writeBundleResources(org.jomc.model.Implementation, java.io.File)writeBundleSources(java.io.File)writeBundleSources(org.jomc.model.Module, java.io.File)writeBundleSources(org.jomc.model.Implementation, java.io.File)
JomcTool.getModules()| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jomc.tools.JomcTool |
|---|
JomcTool.Listener |
| Field Summary | |
|---|---|
private static String |
BUNDLE_SUFFIX
Constant for the suffix appended to implementation identifiers. |
private static String |
BUNDLE_TEMPLATE
Location of the Bundle.java.vm template. |
private Locale |
defaultLocale
The language of the default language properties file of the bundle. |
private static String |
GENERATOR_NAME
Name of the generator. |
private static String |
GENERATOR_VERSION
Constant for the version of the generator. |
| Constructor Summary | |
|---|---|
JavaBundles()
Creates a new JavaBundles instance. |
|
JavaBundles(JavaBundles tool)
Creates a new JavaBundles instance taking a JavaBundles instance to initialize the instance with. |
|
| Method Summary | |
|---|---|
private void |
assertValidTemplates(Implementation implementation)
|
Locale |
getDefaultLocale()
Gets the language of the default language properties file of the bundle. |
private String |
getMessage(String key,
Object args)
|
Map<Locale,Properties> |
getResourceBundleResources(Implementation implementation)
Gets the resource bundle properties of a given implementation. |
String |
getResourceBundleSources(Implementation implementation)
Gets the source code of the Java class for accessing the resource bundle of a given implementation. |
VelocityContext |
getVelocityContext()
Gets the velocity context used for merging templates. |
void |
setDefaultLocale(Locale value)
Sets the language of the default language properties file of the bundle. |
void |
writeBundleResources(File resourcesDirectory)
Writes bundle resources of the modules of the instance to a given directory. |
void |
writeBundleResources(Implementation implementation,
File resourcesDirectory)
Writes the bundle resources of a given implementation from the modules of the instance to a directory. |
void |
writeBundleResources(Module module,
File resourcesDirectory)
Writes bundle resources of a given module from the modules of the instance to a given directory. |
void |
writeBundleSources(File sourcesDirectory)
Writes bundle sources of the modules of the instance to a given directory. |
void |
writeBundleSources(Implementation implementation,
File sourcesDirectory)
Writes bundle sources of a given implementation from the modules of the instance to a given directory. |
void |
writeBundleSources(Module module,
File sourcesDirectory)
Writes bundle sources of a given module from the modules of the instance to a given directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String GENERATOR_NAME
private static final String GENERATOR_VERSION
private static final String BUNDLE_TEMPLATE
Bundle.java.vm template.
private static final String BUNDLE_SUFFIX
private Locale defaultLocale
| Constructor Detail |
|---|
public JavaBundles()
JavaBundles instance.
public JavaBundles(JavaBundles tool)
JavaBundles instance taking a JavaBundles instance to initialize the instance with.
tool - The instance to initialize the new instance with,| Method Detail |
|---|
public Locale getDefaultLocale()
setDefaultLocale(java.util.Locale)public void setDefaultLocale(Locale value)
value - The language of the default language properties file of the bundle.getDefaultLocale()
public void writeBundleSources(File sourcesDirectory)
throws IOException
sourcesDirectory - The directory to write sources to.
NullPointerException - if sourcesDirectory is null.
IOException - if writing fails.writeBundleSources(org.jomc.model.Module, java.io.File)
public void writeBundleSources(Module module,
File sourcesDirectory)
throws IOException
module - The module to process.sourcesDirectory - The directory to write sources to.
NullPointerException - if module or sourcesDirectory is null.
IOException - if writing fails.writeBundleSources(org.jomc.model.Implementation, java.io.File)
public void writeBundleSources(Implementation implementation,
File sourcesDirectory)
throws IOException
implementation - The implementation to process.sourcesDirectory - The directory to write sources to.
NullPointerException - if implementation or sourcesDirectory is null.
IOException - if writing fails.getResourceBundleSources(org.jomc.model.Implementation)
public void writeBundleResources(File resourcesDirectory)
throws IOException
resourcesDirectory - The directory to write resources to.
NullPointerException - if resourcesDirectory is null.
IOException - if writing fails.writeBundleResources(org.jomc.model.Module, java.io.File)
public void writeBundleResources(Module module,
File resourcesDirectory)
throws IOException
module - The module to process.resourcesDirectory - The directory to write resources to.
NullPointerException - if module or resourcesDirectory is null.
IOException - if writing fails.writeBundleResources(org.jomc.model.Implementation, java.io.File)
public void writeBundleResources(Implementation implementation,
File resourcesDirectory)
throws IOException
implementation - The implementation to process.resourcesDirectory - The directory to write resources to.
NullPointerException - if implementation or resourcesDirectory is null.
IOException - if writing fails.getResourceBundleResources(org.jomc.model.Implementation)
public String getResourceBundleSources(Implementation implementation)
throws IOException
implementation - The implementation to get the source code of.
implementation.
NullPointerException - if implementation is null.
IOException - if getting the source code fails.
public Map<Locale,Properties> getResourceBundleResources(Implementation implementation)
throws IOException
implementation - The implementation to get resource bundle properties of.
implementation.
NullPointerException - if implementation is null.
IOException - if getting the resources fails.public VelocityContext getVelocityContext()
getVelocityContext in class JomcToolprivate void assertValidTemplates(Implementation implementation)
private String getMessage(String key,
Object args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||