xdoclet.modules.hibernate

Class HibernateTagsHandler


public class HibernateTagsHandler
extends xdoclet.XDocletTagSupport

Specific tags handler to make the template easy.
Version:
$Revision: 1.38 $
Author:
Sibastien Guimont (sebastieng@sympatico.ca)
xdoclet.taghandler
namespace = "Hibernate"
created
August 9th, 2002

Field Summary

Fields inherited from class xdoclet.XDocletTagSupport

FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER

Method Summary

String
computeColumnName(Properties attributes)
The column name for a component is prefix + basename
String
dataSource()
Data source JNDI Name extractor.
String
dialect()
SQL dialect extractor.
String
driver()
Driver Name extractor.
String
factoryClass()
classname extractor.
void
forAllJndiProperties(String template, Properties attributes)
Iterates over all jndiProperties specified.
void
forAllOtherMappings(String template, Properties attributes)
Iterates over all otherMappings specified.
void
forAllOtherProperties(String template, Properties attributes)
Iterates over all otherProperties specified.
void
forAllPersistentClasses(String template, Properties attributes)
Iterates over all classes marked as persistent.
void
forAllSubclasses(String template, Properties attributes)
Iterates over all classes loaded by javadoc that are direct subclasses of the current class and evaluates the body of the tag for each class.
String
getCurrentMappingElement(Properties attributes)
String
getCurrentTag(Properties attributes)
FactoryClassSubTask
getFactoryClassSubTask()
String
getFileName()
Returns full path of hibernate file for the current class.
HibernateProperties
getHibernateProperties()
XMethod
getIdMethod()
find id property of current class.
JBossServiceSubTask
getJBossServiceSubTask()
void
ifCurrentMappingElementIsnt(String template, Properties attributes)
Render template if the current mapping element is not the one specified.
void
ifGeneratePropertyCache(String template, Properties attributes)
Render template if all of the properties needed are valid.
void
ifHasCompositeId(String template, Properties attributes)
Render template if ID is composite.
void
ifHasJndiName(String template, Properties attributes)
Render template if jndiName of JBossServiceSubtask is valid.
void
ifHasPrimitiveId(String template, Properties attributes)
Render template if id is primitive.
void
ifNotHasJndiName(String template, Properties attributes)
Render template if jndiName of JBossServiceSubtask is not valid.
void
ifNotUseJndiFactory(String template, Properties attributes)
Render template if jndiName of JBossServiceSubtask is valid.
void
ifUseJndiFactory(String template, Properties attributes)
Render template if jndiName of JBossServiceSubtask is valid.
String
jdbcUrl()
JDBC URL extractor.
String
jndiName()
Configured JNDI name.
String
jndiParameterName()
String
jndiParameterValue()
void
logMapping(Properties attributes)
Print the name of the current class to the console.
String
mappingList()
Comma separated list of hibernate mappings.
String
otherMappingName()
String
otherMappingValue()
String
otherParameterName()
String
otherParameterValue()
String
password()
password extractor.
String
poolSize()
poolSize extractor.
String
roleAttribute(Properties attributes)
Get the attribute used for collection property names in this version of Hibernate (ie.
String
serviceClassName(Properties attributes)
Get the name of the class the implements the SessionFactory as a MBean is this version of Hibernate.
String
serviceName()
Return configured service name.
void
setColumnPrefix(String template, Properties attributes)
Set the prefix for the \@hibernate.component, as there may be more than one component in a class that refer to the same target class.
void
setCurrentTag(String template, Properties attributes)
String
userName()
username extractor.

Methods inherited from class xdoclet.XDocletTagSupport

delimit, expandClassName, generate, getCurrentClass, getCurrentClassTag, getCurrentConstructor, getCurrentField, getCurrentFieldTag, getCurrentMethod, getCurrentMethodTag, getCurrentPackage, getDocletContext, getEngine, getExpandedDelimitedTagValue, getTagValue, getTagValue, getTagValue, hasHavingClassTag, hasTag, isTagValueEqual, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, modifiers, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage

Methods inherited from class xdoclet.template.TemplateTagHandler

getXJavaDoc, setXJavaDoc

Method Details

computeColumnName

public String computeColumnName(Properties attributes)
The column name for a component is prefix + basename
Parameters:
attributes -
Returns:

dataSource

public String dataSource()
            throws xdoclet.XDocletException
Data source JNDI Name extractor.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

dialect

public String dialect()
            throws xdoclet.XDocletException
SQL dialect extractor.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

driver

public String driver()
            throws xdoclet.XDocletException
Driver Name extractor.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

factoryClass

public String factoryClass()
            throws xdoclet.XDocletException
classname extractor.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

forAllJndiProperties

public void forAllJndiProperties(String template,
                                 Properties attributes)
            throws xdoclet.XDocletException
Iterates over all jndiProperties specified.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException - Description of Exception
doc.tag
type = "block"

forAllOtherMappings

public void forAllOtherMappings(String template,
                                Properties attributes)
            throws xdoclet.XDocletException
Iterates over all otherMappings specified.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException - Description of Exception
doc.tag
type = "block"

forAllOtherProperties

public void forAllOtherProperties(String template,
                                  Properties attributes)
            throws xdoclet.XDocletException
Iterates over all otherProperties specified.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException - Description of Exception
doc.tag
type = "block"

forAllPersistentClasses

public void forAllPersistentClasses(String template,
                                    Properties attributes)
            throws xdoclet.XDocletException
Iterates over all classes marked as persistent.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException - Description of Exception
doc.tag
type = "block"

forAllSubclasses

public void forAllSubclasses(String template,
                             Properties attributes)
            throws xdoclet.XDocletException
Iterates over all classes loaded by javadoc that are direct subclasses of the current class and evaluates the body of the tag for each class. It discards classes that have an xdoclet-generated class tag defined.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException - Description of Exception
doc.tag
type = "block"

getCurrentMappingElement

public String getCurrentMappingElement(Properties attributes)

getCurrentTag

public String getCurrentTag(Properties attributes)

getFactoryClassSubTask

public FactoryClassSubTask getFactoryClassSubTask()

getFileName

public String getFileName()
            throws xdoclet.XDocletException
Returns full path of hibernate file for the current class.
Returns:
The full file path of the current class.
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

getHibernateProperties

public HibernateProperties getHibernateProperties()
            throws xdoclet.XDocletException

getIdMethod

public XMethod getIdMethod()
            throws xdoclet.XDocletException
find id property of current class.
Returns:
Throws:
xdoclet.XDocletException -

getJBossServiceSubTask

public JBossServiceSubTask getJBossServiceSubTask()

ifCurrentMappingElementIsnt

public void ifCurrentMappingElementIsnt(String template,
                                        Properties attributes)
            throws xdoclet.XDocletException
Render template if the current mapping element is not the one specified.
Parameters:
template - the template
attributes - the tag attributes
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifGeneratePropertyCache

public void ifGeneratePropertyCache(String template,
                                    Properties attributes)
            throws xdoclet.XDocletException
Render template if all of the properties needed are valid.
Parameters:
template -
attributes -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifHasCompositeId

public void ifHasCompositeId(String template,
                             Properties attributes)
            throws xdoclet.XDocletException
Render template if ID is composite.
Parameters:
template -
attributes -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifHasJndiName

public void ifHasJndiName(String template,
                          Properties attributes)
            throws xdoclet.XDocletException
Render template if jndiName of JBossServiceSubtask is valid. This is a required parameter, but the user might not be using that subtask.
Parameters:
template -
attributes -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifHasPrimitiveId

public void ifHasPrimitiveId(String template,
                             Properties attributes)
            throws xdoclet.XDocletException
Render template if id is primitive.
Parameters:
template -
attributes -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifNotHasJndiName

public void ifNotHasJndiName(String template,
                             Properties attributes)
            throws xdoclet.XDocletException
Render template if jndiName of JBossServiceSubtask is not valid.
Parameters:
template -
attributes -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifNotUseJndiFactory

public void ifNotUseJndiFactory(String template,
                                Properties attributes)
            throws xdoclet.XDocletException
Render template if jndiName of JBossServiceSubtask is valid. This is a required parameter, but the user might not be using that subtask.
Parameters:
template -
attributes -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifUseJndiFactory

public void ifUseJndiFactory(String template,
                             Properties attributes)
            throws xdoclet.XDocletException
Render template if jndiName of JBossServiceSubtask is valid. This is a required parameter, but the user might not be using that subtask.
Parameters:
template -
attributes -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

jdbcUrl

public String jdbcUrl()
            throws xdoclet.XDocletException
JDBC URL extractor.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

jndiName

public String jndiName()
            throws xdoclet.XDocletException
Configured JNDI name.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

jndiParameterName

public String jndiParameterName()

jndiParameterValue

public String jndiParameterValue()

logMapping

public void logMapping(Properties attributes)
            throws xdoclet.XDocletException
Print the name of the current class to the console.
Parameters:
attributes -
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

mappingList

public String mappingList()
            throws xdoclet.XDocletException
Comma separated list of hibernate mappings.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

otherMappingName

public String otherMappingName()

otherMappingValue

public String otherMappingValue()

otherParameterName

public String otherParameterName()

otherParameterValue

public String otherParameterValue()

password

public String password()
            throws xdoclet.XDocletException
password extractor.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

poolSize

public String poolSize()
            throws xdoclet.XDocletException
poolSize extractor.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

roleAttribute

public String roleAttribute(Properties attributes)
Get the attribute used for collection property names in this version of Hibernate (ie. "role" or "name").
Parameters:
attributes -
Returns:

serviceClassName

public String serviceClassName(Properties attributes)
Get the name of the class the implements the SessionFactory as a MBean is this version of Hibernate.
Parameters:
attributes -
Returns:

serviceName

public String serviceName()
            throws xdoclet.XDocletException
Return configured service name.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

setColumnPrefix

public void setColumnPrefix(String template,
                            Properties attributes)
            throws xdoclet.XDocletException
Set the prefix for the \@hibernate.component, as there may be more than one component in a class that refer to the same target class.
Parameters:
template -
attributes -
Throws:
xdoclet.XDocletException -

setCurrentTag

public void setCurrentTag(String template,
                          Properties attributes)
            throws xdoclet.XDocletException

userName

public String userName()
            throws xdoclet.XDocletException
username extractor.
Returns:
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"