xdoclet.modules.ejb.entity

Class CmpTagsHandler


public class CmpTagsHandler
extends EntityTagsHandler

Version:
$Revision: 1.17 $
Author:
Ara Abrahamian (ara_e@email.com)
xdoclet.taghandler
namespace = "EjbCmp"
created
Oct 16, 2001

Method Summary

String
dbmsColumn()
Returns the dbms column.
String
dbmsTable()
Returns the table name for the current class.
String
entityCmpClass()
Returns the name of generated CMP class.
String
fieldName()
Returns the cmp-version 2.x compatible cmp / cmr field name for the current method.
void
forAllCmpEntityBeans(String template)
Evaluates the body block for each EJBean derived from EntityBean which is CMP.
void
forAllCmpFields(String template)
Evaluates the body block for each persistent field of current class (if entity CMP).
static String
getEntityCmpClassFor(XClass clazz)
Gets the EntityCmpClassFor attribute of the CmpTagsHandler class
protected static String
getEntityCmpClassPattern()
Gets the EntityCmpClassPattern attribute of the CmpTagsHandler class
static String
getFieldNameFor(XMethod method)
Returns the cmp-version 2.x compatible cmp / cmr field name for the passed method.
void
ifEntityIsCmp(String template)
Evaluates the body block if current class is an CMP entity bean.
void
ifIsPersistent(String template)
void
ifNotUsingCmp2(String template)
Evaluate the body block if not using EJB 2.0 or using EJB 2.0 but CMP version 1.x.
void
ifUsingCmp2(String template)
Evaluate the body block if using EJB 2.0 and CMP version 2.x.
static boolean
isEntityCmp(XClass clazz)
Returns true if clazz is an CMP entity bean, false otherwise.
static boolean
isUsingCmp2Impl(XClass clazz)
Returns true if ejbspec config parameter is "2.0" and ejb:bean's cmp-version either not defined or is "2.x", false otherwise.

Method Details

dbmsColumn

public String dbmsColumn()
            throws xdoclet.XDocletException
Returns the dbms column. Looks for ejb.persistence column-name, then for legacy app-server specific tags, then propertyName as a fall-back
Returns:
Throws:
xdoclet.XDocletException -
To do:
add more tags/params here

dbmsTable

public String dbmsTable()
            throws xdoclet.XDocletException
Returns the table name for the current class.
Returns:
Throws:
xdoclet.XDocletException -
To do:
add more tags/params here

entityCmpClass

public String entityCmpClass()
            throws xdoclet.XDocletException
Returns the name of generated CMP class.
Returns:
The name of generated CMP class.
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

fieldName

public String fieldName()
            throws xdoclet.XDocletException
Returns the cmp-version 2.x compatible cmp / cmr field name for the current method.
Returns:
the field name
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

forAllCmpEntityBeans

public void forAllCmpEntityBeans(String template)
            throws xdoclet.XDocletException
Evaluates the body block for each EJBean derived from EntityBean which is CMP.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
isEntityCmp(xjavadoc.XClass)
doc.tag
type = "block"

forAllCmpFields

public void forAllCmpFields(String template)
            throws xdoclet.XDocletException
Evaluates the body block for each persistent field of current class (if entity CMP). Looks at super classes as well. Searches for the getter methods which has ejb:persistent-field defined.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
isEntityCmp(xjavadoc.XClass), xdoclet.modules.ejb.entity.PersistentTagsHandler.isPersistentField(xjavadoc.XMethod), xdoclet.tagshandler.MethodTagsHandler.isGetter(java.lang.String)
doc.tag
type = "block"

getEntityCmpClassFor

public static String getEntityCmpClassFor(XClass clazz)
Gets the EntityCmpClassFor attribute of the CmpTagsHandler class
Parameters:
clazz - Describe what the parameter does
Returns:
The EntityCmpClassFor value

getEntityCmpClassPattern

protected static String getEntityCmpClassPattern()
Gets the EntityCmpClassPattern attribute of the CmpTagsHandler class
Returns:
The EntityCmpClassPattern value

getFieldNameFor

public static String getFieldNameFor(XMethod method)
            throws xdoclet.XDocletException
Returns the cmp-version 2.x compatible cmp / cmr field name for the passed method.
Parameters:
method - the method
Returns:
the field name
Throws:
xdoclet.XDocletException -

ifEntityIsCmp

public void ifEntityIsCmp(String template)
            throws xdoclet.XDocletException
Evaluates the body block if current class is an CMP entity bean.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifIsPersistent

public void ifIsPersistent(String template)
            throws xdoclet.XDocletException

ifNotUsingCmp2

public void ifNotUsingCmp2(String template)
            throws xdoclet.XDocletException
Evaluate the body block if not using EJB 2.0 or using EJB 2.0 but CMP version 1.x.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
isUsingCmp2Impl(xjavadoc.XClass), ifUsingCmp2(java.lang.String)
doc.tag
type = "block"

ifUsingCmp2

public void ifUsingCmp2(String template)
            throws xdoclet.XDocletException
Evaluate the body block if using EJB 2.0 and CMP version 2.x.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
isUsingCmp2Impl(xjavadoc.XClass), ifNotUsingCmp2(java.lang.String)
doc.tag
type = "block"

isEntityCmp

public static boolean isEntityCmp(XClass clazz)
            throws xdoclet.XDocletException
Returns true if clazz is an CMP entity bean, false otherwise. Entity type is determined by looking at the ejb:bean's type parameter.
Parameters:
clazz - Description of Parameter
Returns:
The EntityCmp value
Throws:
xdoclet.XDocletException -
To do:
refactor this method up in superclass with isEntityBmp

isUsingCmp2Impl

public static boolean isUsingCmp2Impl(XClass clazz)
            throws xdoclet.XDocletException
Returns true if ejbspec config parameter is "2.0" and ejb:bean's cmp-version either not defined or is "2.x", false otherwise.
Parameters:
clazz -
Returns:
Description of the Returned Value
Throws:
xdoclet.XDocletException -