xdoclet.modules.ejb.entity

Class CmpTagsHandler

public class CmpTagsHandler extends EntityTagsHandler

Version: $Revision: 1.17 $

Author: Ara Abrahamian (ara_e@email.com)

UNKNOWN: Oct 16, 2001 namespace = "EjbCmp"

Method Summary
StringdbmsColumn()
Returns the dbms column.
StringdbmsTable()
Returns the table name for the current class.
StringentityCmpClass()
Returns the name of generated CMP class.
StringfieldName()
Returns the cmp-version 2.x compatible cmp / cmr field name for the current method.
voidforAllCmpEntityBeans(String template)
Evaluates the body block for each EJBean derived from EntityBean which is CMP.
voidforAllCmpFields(String template)
Evaluates the body block for each persistent field of current class (if entity CMP).
static StringgetEntityCmpClassFor(XClass clazz)
Gets the EntityCmpClassFor attribute of the CmpTagsHandler class
protected static StringgetEntityCmpClassPattern()
Gets the EntityCmpClassPattern attribute of the CmpTagsHandler class
static StringgetFieldNameFor(XMethod method)
Returns the cmp-version 2.x compatible cmp / cmr field name for the passed method.
voidifEntityIsCmp(String template)
Evaluates the body block if current class is an CMP entity bean.
voidifIsPersistent(String template)
voidifNotUsingCmp2(String template)
Evaluate the body block if not using EJB 2.0 or using EJB 2.0 but CMP version 1.x.
voidifUsingCmp2(String template)
Evaluate the body block if using EJB 2.0 and CMP version 2.x.
static booleanisEntityCmp(XClass clazz)
Returns true if clazz is an CMP entity bean, false otherwise.
static booleanisUsingCmp2Impl(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 Detail

dbmsColumn

public String dbmsColumn()
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: XDocletException

UNKNOWN: add more tags/params here

dbmsTable

public String dbmsTable()
Returns the table name for the current class.

Returns:

Throws: XDocletException

UNKNOWN: add more tags/params here

entityCmpClass

public String entityCmpClass()
Returns the name of generated CMP class.

Returns: The name of generated CMP class.

Throws: XDocletException

UNKNOWN: type = "content"

fieldName

public String fieldName()
Returns the cmp-version 2.x compatible cmp / cmr field name for the current method.

Returns: the field name

Throws: XDocletException

UNKNOWN: type = "content"

forAllCmpEntityBeans

public void forAllCmpEntityBeans(String template)
Evaluates the body block for each EJBean derived from EntityBean which is CMP.

Parameters: template The body of the block tag

Throws: XDocletException

See Also: CmpTagsHandler

UNKNOWN: type = "block"

forAllCmpFields

public void forAllCmpFields(String template)
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: XDocletException

See Also: CmpTagsHandler PersistentTagsHandler MethodTagsHandler

UNKNOWN: 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)
Returns the cmp-version 2.x compatible cmp / cmr field name for the passed method.

Parameters: method the method

Returns: the field name

Throws: XDocletException

ifEntityIsCmp

public void ifEntityIsCmp(String template)
Evaluates the body block if current class is an CMP entity bean.

Parameters: template The body of the block tag

Throws: XDocletException

UNKNOWN: type = "block"

ifIsPersistent

public void ifIsPersistent(String template)

ifNotUsingCmp2

public void ifNotUsingCmp2(String template)
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: XDocletException

See Also: CmpTagsHandler CmpTagsHandler

UNKNOWN: type = "block"

ifUsingCmp2

public void ifUsingCmp2(String template)
Evaluate the body block if using EJB 2.0 and CMP version 2.x.

Parameters: template The body of the block tag

Throws: XDocletException

See Also: CmpTagsHandler CmpTagsHandler

UNKNOWN: type = "block"

isEntityCmp

public static boolean isEntityCmp(XClass clazz)
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: XDocletException

UNKNOWN: refactor this method up in superclass with isEntityBmp

isUsingCmp2Impl

public 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.

Parameters: clazz

Returns: Description of the Returned Value

Throws: XDocletException