org.codehaus.mojo.appfuse.utility
Class ConfigurationUtility

java.lang.Object
  extended by org.codehaus.mojo.appfuse.utility.ConfigurationUtility
Direct Known Subclasses:
JDBCConfigurationUtility

public class ConfigurationUtility
extends java.lang.Object

This class serves as a generic configuration utility to prepare configuations to pass to the hibernate exporters.

Version:
$Id$
Author:
Scott Ryan

Field Summary
static org.apache.commons.logging.Log LOG
          A static logger for the class.
 
Constructor Summary
ConfigurationUtility()
          Creates a new ConfigurationUtility object.
 
Method Summary
 void addConfiguredFileSet(org.apache.tools.ant.types.FileSet inFileSet)
          This method will add a new file set objects to the list of file sets to be processed.
protected  boolean addFile(java.io.File inFilename)
          This method will add a file to the configuration depending on the type of file.
protected  org.hibernate.cfg.Configuration createConfiguration()
          This method will jsut return a new Configuration object.
protected  void doConfiguration(org.hibernate.cfg.Configuration inConfiguration)
          This method will run some basic preparation and procssing tasks on the configuration such as loading properties files from the file system into a properties object, loading naming strategy classes and entity resolver classes.
 org.hibernate.cfg.Configuration getConfiguration()
          This method will create a configuration and do some initial processing on that configuration.
 java.io.File getConfigurationFile()
          Getter for property configuration file.
 java.io.File getPropertyFile()
          Getter for property property file.
 void setConfigurationFile(java.io.File inConfigurationFile)
          Setter for the configuration file.
 void setEntityResolver(java.lang.String inEntityResolverName)
          Setter for the entity resolver.
 void setNamingStrategy(java.lang.String inNamingStrategy)
          Setter for the naming strategy.
 void setPropertyFile(java.io.File inPropertyFile)
          Setter for the property file.
protected  void validateParameters()
          This method will validate any parameters that need to be validated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
A static logger for the class.

Constructor Detail

ConfigurationUtility

public ConfigurationUtility()
Creates a new ConfigurationUtility object.

Method Detail

addConfiguredFileSet

public void addConfiguredFileSet(org.apache.tools.ant.types.FileSet inFileSet)
This method will add a new file set objects to the list of file sets to be processed.

Parameters:
inFileSet - A file set to be processed.

getConfiguration

public final org.hibernate.cfg.Configuration getConfiguration()
                                                       throws org.apache.maven.plugin.MojoExecutionException
This method will create a configuration and do some initial processing on that configuration.

Returns:
The existing configuration or a newly created one.
Throws:
org.apache.maven.plugin.MojoExecutionException - thrown if the configuration cannot be constructed.

createConfiguration

protected org.hibernate.cfg.Configuration createConfiguration()
This method will jsut return a new Configuration object.

Returns:
A hibernate configuration object.

doConfiguration

protected void doConfiguration(org.hibernate.cfg.Configuration inConfiguration)
                        throws org.apache.maven.plugin.MojoExecutionException
This method will run some basic preparation and procssing tasks on the configuration such as loading properties files from the file system into a properties object, loading naming strategy classes and entity resolver classes.

Parameters:
inConfiguration - The configuration to configure.
Throws:
org.apache.maven.plugin.MojoExecutionException - Thrown if the configuration properties cannot be loaded.

validateParameters

protected void validateParameters()
This method will validate any parameters that need to be validated.


addFile

protected boolean addFile(java.io.File inFilename)
                   throws org.apache.maven.plugin.MojoExecutionException
This method will add a file to the configuration depending on the type of file.

Parameters:
inFilename - the file name to add to the configuration.
Returns:
true if the file was added successfully to the configuration.
Throws:
org.apache.maven.plugin.MojoExecutionException - thrown if the file could not be added to the configuration.

getConfigurationFile

public java.io.File getConfigurationFile()
Getter for property configuration file.

Returns:
The value of configuration file.

setConfigurationFile

public void setConfigurationFile(java.io.File inConfigurationFile)
Setter for the configuration file.

Parameters:
inConfigurationFile - The value of configuration file.

getPropertyFile

public java.io.File getPropertyFile()
Getter for property property file.

Returns:
The value of property file.

setPropertyFile

public void setPropertyFile(java.io.File inPropertyFile)
Setter for the property file.

Parameters:
inPropertyFile - The value of property file.

setEntityResolver

public void setEntityResolver(java.lang.String inEntityResolverName)
Setter for the entity resolver.

Parameters:
inEntityResolverName - The value of entity resolver.

setNamingStrategy

public void setNamingStrategy(java.lang.String inNamingStrategy)
Setter for the naming strategy.

Parameters:
inNamingStrategy - The value of naming strategy.


Copyright © 2006-2009. All Rights Reserved.