org.codehaus.mojo.hibernate3
Class HibernateExporterMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.hibernate3.HibernateExporterMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.codehaus.mojo.hibernate3.ExporterMojo
Direct Known Subclasses:
GenericExporterMojo, Hbm2CfgXmlExporterMojo, Hbm2DDLExporterMojo, Hbm2DocExporterMojo, Hbm2HbmXmlExporterMojo, Hbm2JavaGeneratorMojo

public abstract class HibernateExporterMojo
extends org.apache.maven.plugin.AbstractMojo
implements org.codehaus.mojo.hibernate3.ExporterMojo

Base class for the different hibernate3 goals based on the Ant tasks of hibernate tools.

Version:
$Id: HibernateExporterMojo.java 6588 2008-03-28 12:22:57Z bentmann $
Author:
Johann Reyes, Tim O'Brien

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
HibernateExporterMojo()
           
 
Method Summary
protected  void addDefaultComponent(java.lang.String outputDirectory, java.lang.String implementation, boolean jdk5)
          Adds a default goal.
protected  org.hibernate.tool.hbm2x.Exporter configureExporter(org.hibernate.tool.hbm2x.Exporter exporter)
          Configures the Exporter.
protected abstract  org.hibernate.tool.hbm2x.Exporter createExporter()
          Gets the hibernate tool exporter based on the goal that is being called.
protected  void doExecute()
          Executes the plugin in an isolated classloader.
 void execute()
           
protected  Component getComponent()
          Returns the parsed goal to the exporter.
protected  org.codehaus.mojo.hibernate3.configuration.ComponentConfiguration getComponentConfiguration(java.lang.String name)
          Returns the ComponentConfiguration for this maven goal.
 java.lang.String getComponentProperty(java.lang.String key)
           
 boolean getComponentProperty(java.lang.String key, boolean defaultValue)
           
 java.lang.String getComponentProperty(java.lang.String key, java.lang.String defaultValue)
           
 org.apache.maven.project.MavenProject getProject()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.mojo.hibernate3.ExporterMojo
getName
 
Methods inherited from interface org.apache.maven.plugin.Mojo
getLog, setLog
 

Constructor Detail

HibernateExporterMojo

public HibernateExporterMojo()
Method Detail

getProject

public org.apache.maven.project.MavenProject getProject()
Specified by:
getProject in interface org.codehaus.mojo.hibernate3.ExporterMojo
See Also:
ExporterMojo#getProject()

getComponentProperty

public boolean getComponentProperty(java.lang.String key,
                                    boolean defaultValue)
Specified by:
getComponentProperty in interface org.codehaus.mojo.hibernate3.ExporterMojo
See Also:
ExporterMojo#getComponentProperty(String,boolean)

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Specified by:
execute in interface org.apache.maven.plugin.Mojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
See Also:
Mojo.execute()

addDefaultComponent

protected void addDefaultComponent(java.lang.String outputDirectory,
                                   java.lang.String implementation,
                                   boolean jdk5)
Adds a default goal.

Parameters:
outputDirectory - Default output directory
implementation - Default configuration implementation
jdk5 - Is this goal being setup for jdk15?

configureExporter

protected org.hibernate.tool.hbm2x.Exporter configureExporter(org.hibernate.tool.hbm2x.Exporter exporter)
                                                       throws org.apache.maven.plugin.MojoExecutionException
Configures the Exporter.

Parameters:
exporter - Exporter to configure
Returns:
Exporter
Throws:
org.apache.maven.plugin.MojoExecutionException - if there is an error configuring the exporter

getComponentConfiguration

protected org.codehaus.mojo.hibernate3.configuration.ComponentConfiguration getComponentConfiguration(java.lang.String name)
                                                                                               throws org.apache.maven.plugin.MojoExecutionException
Returns the ComponentConfiguration for this maven goal.

Parameters:
name - Configuration task name
Returns:
ComponentConfiguration
Throws:
org.apache.maven.plugin.MojoExecutionException - if there is an error finding the ConfigurationTask

getComponentProperty

public java.lang.String getComponentProperty(java.lang.String key)
Specified by:
getComponentProperty in interface org.codehaus.mojo.hibernate3.ExporterMojo
See Also:
ExporterMojo#getComponentProperty(String)

getComponentProperty

public java.lang.String getComponentProperty(java.lang.String key,
                                             java.lang.String defaultValue)
Specified by:
getComponentProperty in interface org.codehaus.mojo.hibernate3.ExporterMojo
See Also:
ExporterMojo#getComponentProperty(String,String)

createExporter

protected abstract org.hibernate.tool.hbm2x.Exporter createExporter()
Gets the hibernate tool exporter based on the goal that is being called.

Returns:
Goal exporter

doExecute

protected void doExecute()
                  throws org.apache.maven.plugin.MojoExecutionException
Executes the plugin in an isolated classloader.

Throws:
org.apache.maven.plugin.MojoExecutionException - When there is an erro executing the plugin

getComponent

protected Component getComponent()
Returns the parsed goal to the exporter.

Returns:
Component


Copyright © 2005-2009. All Rights Reserved.