xdoclet.ejb.tags
Class CmpTagsHandler

java.lang.Object
  |
  +--xdoclet.template.TemplateTagHandler
        |
        +--xdoclet.XDocletTagSupport
              |
              +--xdoclet.ejb.tags.EjbTagsHandler
                    |
                    +--xdoclet.ejb.tags.EntityTagsHandler
                          |
                          +--xdoclet.ejb.tags.CmpTagsHandler
Direct Known Subclasses:
PersistentTagsHandler

public class CmpTagsHandler
extends EntityTagsHandler

Version:
$Revision: 1.13 $
Author:
Ara Abrahamian (ara_e@email.com)

Fields inherited from class xdoclet.ejb.tags.EjbTagsHandler
LOCAL_SUFFIX
 
Fields inherited from class xdoclet.XDocletTagSupport
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
 
Constructor Summary
CmpTagsHandler()
           
 
Method Summary
 java.lang.String entityCmpClass()
          Returns the name of generated CMP class.
 void forAllCmpEntityBeans(java.lang.String template)
          Evaluates the body block for each EJBean derived from EntityBean which is CMP.
 void forAllCmpFields(java.lang.String template)
          Evaluates the body block for each persistent field of current class (if entity CMP).
static java.lang.String getEntityCmpClassFor(com.sun.javadoc.ClassDoc clazz)
           
protected static java.lang.String getEntityCmpClassPattern()
           
 void ifEntityIsCmp(java.lang.String template)
          Evaluates the body block if current class is an CMP entity bean.
 void ifNotUsingCmp2(java.lang.String template)
          Evaluate the body block if not using EJB 2.0 or using EJB 2.0 but CMP version 1.x.
 void ifUsingCmp2(java.lang.String template)
          Evaluate the body block if using EJB 2.0 and CMP version 2.x.
static boolean isEntityCmp(com.sun.javadoc.ClassDoc clazz)
          Returns true if clazz is an CMP entity bean, false otherwise.
static boolean isUsingCmp2Impl(com.sun.javadoc.ClassDoc 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.
 
Methods inherited from class xdoclet.ejb.tags.EntityTagsHandler
forAllEntityBeans, ifEntity, isEntity, persistenceType, reentrant
 
Methods inherited from class xdoclet.ejb.tags.EjbTagsHandler
beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, extendsFromFor, forAllBeans, getDependentClassFor, getDependentClassTagName, getEjbIdFor, getEjbNameFor, getEjbSpec, getShortEjbNameFor, hasPermission, hasTransaction, id, ifIsAConcreteEJBean, ifLocalEjb, ifNotLocalEjb, ifNotRemoteEjb, ifRemoteEjb, isAConcreteEJBean, isEjb, isLocalEjb, isOnlyLocalEjb, isOnlyRemoteEjb, isRemoteEjb, prefixWithEjbSlash, shortEjbName, shouldTraverseSuperclassForDependentClass, symbolicClassName
 
Methods inherited from class xdoclet.XDocletTagSupport
getClassTagValue, getClassTagValue, getConstructorTagValue, getCurrentClass, getCurrentConstructor, getCurrentField, getCurrentMethod, getCurrentPackage, getCurrentTag, getDocletContext, getFieldTagValue, getFieldTagValue, getMethodTagValue, getMethodTagValue, getParameterValue, getParameterValue, getTagValue, getTagValue, getTagValue, invalidParamValueFound, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, parsePropertyString, popCurrentClass, pushCurrentClass, replaceProperties, setCurrentClass, setCurrentConstructor, setCurrentField, setCurrentMethod, setCurrentPackage, setCurrentTag, tokenizeValue
 
Methods inherited from class xdoclet.template.TemplateTagHandler
generate, getContext, getEngine, getParser, setContext, setEngine, setParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmpTagsHandler

public CmpTagsHandler()
Method Detail

getEntityCmpClassFor

public static java.lang.String getEntityCmpClassFor(com.sun.javadoc.ClassDoc clazz)
                                             throws XDocletException

isEntityCmp

public static boolean isEntityCmp(com.sun.javadoc.ClassDoc clazz)
                           throws 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:
XDocletException - Description of Exception

isUsingCmp2Impl

public static boolean isUsingCmp2Impl(com.sun.javadoc.ClassDoc clazz)
                               throws 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:
XDocletException - Description of Exception

getEntityCmpClassPattern

protected static java.lang.String getEntityCmpClassPattern()

entityCmpClass

public java.lang.String entityCmpClass()
                                throws XDocletException
Returns the name of generated CMP class.
Returns:
The name of generated CMP class.
Throws:
XDocletException - Description of Exception

ifUsingCmp2

public void ifUsingCmp2(java.lang.String template)
                 throws XDocletException
Evaluate the body block if using EJB 2.0 and CMP version 2.x.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
isUsingCmp2Impl(com.sun.javadoc.ClassDoc), ifNotUsingCmp2(java.lang.String)

ifNotUsingCmp2

public void ifNotUsingCmp2(java.lang.String template)
                    throws 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:
XDocletException - Description of Exception
See Also:
isUsingCmp2Impl(com.sun.javadoc.ClassDoc), ifUsingCmp2(java.lang.String)

ifEntityIsCmp

public void ifEntityIsCmp(java.lang.String template)
                   throws XDocletException
Evaluates the body block if current class is an CMP entity bean.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception

forAllCmpEntityBeans

public void forAllCmpEntityBeans(java.lang.String template)
                          throws XDocletException
Evaluates the body block for each EJBean derived from EntityBean which is CMP.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
isEntityCmp(com.sun.javadoc.ClassDoc)

forAllCmpFields

public void forAllCmpFields(java.lang.String template)
                     throws 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:
XDocletException - Description of Exception
See Also:
isEntityCmp(com.sun.javadoc.ClassDoc), PersistentTagsHandler.isPersistentField(com.sun.javadoc.MethodDoc), MethodTagsHandler.isGetter(java.lang.String)