## xdoclet.modules.hibernate
Class HibernateSubTask

    java.lang.Object
      xdoclet.DocletSupport
          xdoclet.SubTask
              xdoclet.TemplateSubTask
                  xdoclet.XmlSubTask
                      xdoclet.modules.hibernate.HibernateSubTask

All Implemented Interfaces:
  Serializable

public class HibernateSubTask
extends XmlSubTask

This task generates Hibernate xml mapping file for a given class. Supports Hibernate 1.1, 2.0, 2.1 & 3.0.

Version:
  $Revision: 1.12 $
Author:
  Sébastien Guimont (sebastieng@sympatico.ca), David Channon
See Also:
  Serialized Form
ant.element
  name="hibernate" display-name="Hibernate Mapping File" parent="xdoclet.modules.hibernate.HibernateDocletTask"
created
  August 9th, 2002

Nested Class Summary
`static class` `HibernateSubTask.HibernateVersion`

Nested classes inherited from class xdoclet.TemplateSubTask
`TemplateSubTask.ExtentTypes, TemplateSubTask.OfType`

Field Summary
`static String` `DEFAULT_HIBERNATE_CLASS_PATTERN`

Fields inherited from class xdoclet.DocletSupport
`currentClassTag, currentFieldTag, currentMethodTag`

Constructor Summary
`HibernateSubTask()` Constructor for the HibernateSubTask object.

Method Summary
`protected void` `engineStarted()` Called when the engine is started
`void` `execute()` Generate Mapping file (*.hbm.xml).
`String` `getGeneratedFileName(xjavadoc.XClass clazz)` Returns the filename of the generated file for a class.
`String` `getMappingURL(xjavadoc.XClass clazz)`
`String` `getVersion()` Get the Hibernate version.
`protected boolean` `processInnerClasses()` Since we want to support static inner classes, we set this to true.
`void` `setVersion(HibernateSubTask.HibernateVersion version)` Sets the hibernate version to use.

Methods inherited from class xdoclet.XmlSubTask
`copyAttributesFrom, engineFinished, getDtdURL, getPublicId, getSchema, getSchemaURL, getSystemId, getUseIds, getXmlencoding, isValidateXML, setDtdURL, setPublicId, setSchema, setSchemaURL, setSystemId, setUseIds, setValidateXML, setXmlencoding, startProcess`

Methods inherited from class xdoclet.TemplateSubTask

`addOfType, addOfType, addPackageSubstitution, generateForClass, getAcceptAbstractClasses, getAcceptInterfaces, getDestinationFile, getEngine, getExtent, getGenerationManager, getHavingClassTag, getOfType, getPackageSubstitutions, getSubTaskClassName, getTemplateURL, init, isPackageSubstitutionInheritanceSupported, isPrefixWithPackageStructure, javaFile, matchesGenerationRules, setAcceptAbstractClasses, setAcceptInterfaces, setDestinationFile, setEngine, setExtent, setExtentValue, setGenerationManager, setHavingClassTag, setOfType, setPackageSubstitutionInheritanceSupported, setPackageSubstitutions, setPrefixWithPackageStructure, setSubTaskClassName, setTemplateFile, setTemplateURL, startEngine, startProcessForAll, startProcessPerClass, validateOptions`

Methods inherited from class xdoclet.SubTask
`addConfigParam, getConfigParams, getConfigParamsAsMap, getContext, getDestDir, getMergeDir, getSubTaskName, getXJavaDoc, setDestDir, setMergeDir, setSubTaskName`

Methods inherited from class xdoclet.DocletSupport
`getCurrentClass, getCurrentClassTag, getCurrentConstructor, getCurrentField, getCurrentFieldTag, getCurrentMethod, getCurrentMethodTag, getCurrentPackage, getCurrentTag, isDocletGenerated, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_HIBERNATE_CLASS_PATTERN

    public static final String DEFAULT_HIBERNATE_CLASS_PATTERN

See Also:
  Constant Field Values

Constructor Detail

### HibernateSubTask

    public HibernateSubTask()

  Constructor for the HibernateSubTask object.

Method Detail

### getGeneratedFileName

    public String getGeneratedFileName(xjavadoc.XClass clazz)
                                throws XDocletException

  Description copied from class: `TemplateSubTask`
  Returns the filename of the generated file for a class. If the string "{0}" is present in the pattern, it will be substituted with the transformed class name.

  Overrides:
    `getGeneratedFileName` in class `TemplateSubTask`
  Parameters:
    `clazz` - the class being processed
  Returns:
    the corresponding filename
  Throws:
    `XDocletException` - Description of Exception

### getMappingURL

    public String getMappingURL(xjavadoc.XClass clazz)

### getVersion

    public String getVersion()

  Get the Hibernate version.

  Returns:

### setVersion

    public void setVersion(HibernateSubTask.HibernateVersion version)

  Sets the hibernate version to use. Legal values are "1.1", "2.0", "2.1" and "3.0".

  Parameters:
    `version` -

### execute

    public void execute()
                 throws XDocletException

  Generate Mapping file (*.hbm.xml).

  Overrides:
    `execute` in class `TemplateSubTask`
  Throws:
    `XDocletException`

### engineStarted

    protected void engineStarted()
                          throws XDocletException

  Called when the engine is started

  Overrides:
    `engineStarted` in class `TemplateSubTask`
  Throws:
    `XDocletException` - Thrown in case of problem

### processInnerClasses

    protected boolean processInnerClasses()

  Since we want to support static inner classes, we set this to true.

  Overrides:
    `processInnerClasses` in class `TemplateSubTask`
  Returns:
    `true`

http://xdoclet.sourceforge.net/