org.jomc.tools
Class JavaBundles

Package class diagram package JavaBundles
java.lang.Object
  extended by org.jomc.tools.JomcTool
      extended by org.jomc.tools.JavaBundles

public class JavaBundles
extends JomcTool

Generates Java bundles.

Use cases

Version:
$Id: JavaBundles.java 891 2009-11-02 03:40:00Z schulte2005 $
Author:
Christian Schulte
See Also:
JomcTool.getModules()

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jomc.tools.JomcTool
JomcTool.Listener
 
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
 Locale getDefaultLocale()
          Gets the language of the default language properties file of the bundle.
 Map<Locale,Properties> getResourceBundleResources(org.jomc.model.Implementation implementation)
          Gets the resource bundle properties of a given implementation.
 String getResourceBundleSources(org.jomc.model.Implementation implementation)
          Gets the source code of the Java class for accessing the resource bundle of a given implementation.
 org.apache.velocity.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(org.jomc.model.Implementation implementation, File resourcesDirectory)
          Writes the bundle resources of a given implementation from the modules of the instance to a directory.
 void writeBundleResources(org.jomc.model.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(org.jomc.model.Implementation implementation, File sourcesDirectory)
          Writes bundle sources of a given implementation from the modules of the instance to a given directory.
 void writeBundleSources(org.jomc.model.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 org.jomc.tools.JomcTool
getDefaultLogLevel, getDisplayLanguage, getInputEncoding, getJavaClasspathLocation, getJavaClasspathLocation, getJavadocComment, getJavaGetterMethodName, getJavaGetterMethodName, getJavaGetterMethodName, getJavaInterfaceNames, getJavaModifierName, getJavaModifierName, getJavaModifierName, getJavaPackageName, getJavaPackageName, getJavaPackageName, getJavaString, getJavaTypeName, getJavaTypeName, getJavaTypeName, getJavaTypeName, getJavaTypeName, getJavaTypeName, getListeners, getLogLevel, getLongDate, getLongDateTime, getLongTime, getModules, getOutputEncoding, getProfile, getShortDate, getShortDateTime, getShortTime, getTemplateEncoding, getVelocityEngine, getVelocityTemplate, getYears, isJavaClassDeclaration, isJavaClassDeclaration, isJavaDefaultPackage, isJavaDefaultPackage, isJavaPrimitiveType, isLoggable, log, setDefaultLogLevel, setInputEncoding, setLogLevel, setModules, setOutputEncoding, setProfile, setTemplateEncoding, setVelocityEngine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaBundles

public JavaBundles()
Creates a new JavaBundles instance.


JavaBundles

public JavaBundles(JavaBundles tool)
Creates a new JavaBundles instance taking a JavaBundles instance to initialize the instance with.

Parameters:
tool - The instance to initialize the new instance with,
Method Detail

getDefaultLocale

public Locale getDefaultLocale()
Gets the language of the default language properties file of the bundle.

Returns:
The language of the default language properties file of the bundle.
See Also:
setDefaultLocale(java.util.Locale)

setDefaultLocale

public void setDefaultLocale(Locale value)
Sets the language of the default language properties file of the bundle.

Parameters:
value - The language of the default language properties file of the bundle.
See Also:
getDefaultLocale()

writeBundleSources

public void writeBundleSources(File sourcesDirectory)
                        throws IOException
Writes bundle sources of the modules of the instance to a given directory.

Parameters:
sourcesDirectory - The directory to write sources to.
Throws:
NullPointerException - if sourcesDirectory is null.
IOException - if writing fails.
See Also:
writeBundleSources(org.jomc.model.Module, java.io.File)

writeBundleSources

public void writeBundleSources(org.jomc.model.Module module,
                               File sourcesDirectory)
                        throws IOException
Writes bundle sources of a given module from the modules of the instance to a given directory.

Parameters:
module - The module to process.
sourcesDirectory - The directory to write sources to.
Throws:
NullPointerException - if module or sourcesDirectory is null.
IOException - if writing fails.
See Also:
writeBundleSources(org.jomc.model.Implementation, java.io.File)

writeBundleSources

public void writeBundleSources(org.jomc.model.Implementation implementation,
                               File sourcesDirectory)
                        throws IOException
Writes bundle sources of a given implementation from the modules of the instance to a given directory.

Parameters:
implementation - The implementation to process.
sourcesDirectory - The directory to write sources to.
Throws:
NullPointerException - if implementation or sourcesDirectory is null.
IOException - if writing fails.
See Also:
getResourceBundleSources(org.jomc.model.Implementation)

writeBundleResources

public void writeBundleResources(File resourcesDirectory)
                          throws IOException
Writes bundle resources of the modules of the instance to a given directory.

Parameters:
resourcesDirectory - The directory to write resources to.
Throws:
NullPointerException - if resourcesDirectory is null.
IOException - if writing fails.
See Also:
writeBundleResources(org.jomc.model.Module, java.io.File)

writeBundleResources

public void writeBundleResources(org.jomc.model.Module module,
                                 File resourcesDirectory)
                          throws IOException
Writes bundle resources of a given module from the modules of the instance to a given directory.

Parameters:
module - The module to process.
resourcesDirectory - The directory to write resources to.
Throws:
NullPointerException - if module or resourcesDirectory is null.
IOException - if writing fails.
See Also:
writeBundleResources(org.jomc.model.Implementation, java.io.File)

writeBundleResources

public void writeBundleResources(org.jomc.model.Implementation implementation,
                                 File resourcesDirectory)
                          throws IOException
Writes the bundle resources of a given implementation from the modules of the instance to a directory.

Parameters:
implementation - The implementation to process.
resourcesDirectory - The directory to write resources to.
Throws:
NullPointerException - if implementation or resourcesDirectory is null.
IOException - if writing fails.
See Also:
getResourceBundleResources(org.jomc.model.Implementation)

getResourceBundleSources

public String getResourceBundleSources(org.jomc.model.Implementation implementation)
                                throws IOException
Gets the source code of the Java class for accessing the resource bundle of a given implementation.

Parameters:
implementation - The implementation to get the source code of.
Returns:
The source code of the Java class for accessing the resource bundle of implementation.
Throws:
NullPointerException - if implementation is null.
IOException - if getting the source code fails.

getResourceBundleResources

public Map<Locale,Properties> getResourceBundleResources(org.jomc.model.Implementation implementation)
                                                  throws IOException
Gets the resource bundle properties of a given implementation.

Parameters:
implementation - The implementation to get resource bundle properties of.
Returns:
Resource bundle properties of implementation.
Throws:
NullPointerException - if implementation is null.
IOException - if getting the resources fails.

getVelocityContext

public org.apache.velocity.VelocityContext getVelocityContext()
Gets the velocity context used for merging templates.

Overrides:
getVelocityContext in class JomcTool
Returns:
The velocity context used for merging templates.


Copyright © 2005-2009 The JOMC Project. All Rights Reserved.