xdoclet.ejb.tags
Class DataObjectTagsHandler

java.lang.Object
  |
  +--xdoclet.template.TemplateTagHandler
        |
        +--xdoclet.XDocletTagSupport
              |
              +--xdoclet.ejb.tags.EjbTagsHandler
                    |
                    +--xdoclet.ejb.tags.DataObjectTagsHandler

public class DataObjectTagsHandler
extends EjbTagsHandler

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

Field Summary
protected static java.lang.String currentDataObjectClassname
           
protected static java.util.HashMap dataObjectClassnames
           
 
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
DataObjectTagsHandler()
           
 
Method Summary
 java.lang.String dataMostSuperObjectClass()
          Returns the data-object class name highest in the hierarchy of derived beans.
 java.lang.String dataObjectClass()
          Returns data-object class name for the bean.
 java.lang.String dataObjectClassNameFromInterfaceName()
          Return the dataobject class name from interface name.
 java.lang.String extendsFrom()
          Returns the name of the class dataobject class extends.
protected  void forAllSuper(java.lang.String template, java.lang.String methodName)
          Browse all super classes and search for a special method to generate it in the current CMP/BMP class.
 void forAllSuperSetData(java.lang.String template)
          Evaluates the body block for each setData method.
 java.lang.String generateDataObjectClass()
           
static java.lang.String generateDataObjectClass(com.sun.javadoc.ClassDoc clazz)
          Used by dataMostSuperObjectClass() to get the data object's full qualified class name.
static java.lang.String getCurrentDataObjectClassname()
           
static java.lang.String getDataMostSuperObjectClass(com.sun.javadoc.ClassDoc clazz)
           
static java.lang.String getDataObjectClassFor(com.sun.javadoc.ClassDoc clazz)
           
protected static java.lang.String getDataObjectClassPattern()
           
protected  java.lang.String getDependentClassFor(com.sun.javadoc.ClassDoc clazz, java.lang.String type)
          sub-classes which deal with patternized class names return a reasonable value
static boolean hasCustomBulkData(com.sun.javadoc.ClassDoc clazz)
           
protected static boolean hasDataEquals(com.sun.javadoc.ClassDoc clazz)
           
 void ifIsAggregate(java.lang.String template)
          Evaluate the body block if ejb:aggregate is defined for current getter method, denoting that the specified getter method returns an aggregated object.
 void ifIsNotAggregate(java.lang.String template)
          Evaluate the body block if ejb:aggregate is not defined for current getter method.
 void ifIsWithDataContainer(java.lang.String pTemplate)
          Evaluate the body block if ejb:data-object container="true".
 void ifIsWithDataMethod(java.lang.String pTemplate)
          Evaluate the body block if ejb:data-object setdata="true".
protected  boolean isAggregate(com.sun.javadoc.MethodDoc method)
          Returns true if method has ejb:aggregate, false otherwise.
 void isDataContentEquals(java.lang.String pTemplate)
           
static boolean isDataObjectMethod(com.sun.javadoc.MethodDoc method)
           
static boolean isGenerationNeeded(com.sun.javadoc.ClassDoc clazz)
          Returns true if ejb:data-object defined and generate param is true, false if not true.
 java.lang.String parentDataObjectClass()
           
static void putDataObjectClassnames(java.lang.String name, java.lang.String value)
           
 java.lang.String serialVersionUID()
           
static void setCurrentDataObjectClassname(java.lang.String current_data_object_classname)
           
 
Methods inherited from class xdoclet.ejb.tags.EjbTagsHandler
beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, extendsFromFor, forAllBeans, 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
 

Field Detail

dataObjectClassnames

protected static java.util.HashMap dataObjectClassnames

currentDataObjectClassname

protected static java.lang.String currentDataObjectClassname
Constructor Detail

DataObjectTagsHandler

public DataObjectTagsHandler()
Method Detail

getDataMostSuperObjectClass

public static java.lang.String getDataMostSuperObjectClass(com.sun.javadoc.ClassDoc clazz)
                                                    throws XDocletException
Parameters:
clazz - Description of Parameter
Returns:
the full qualified data-object class name
Throws:
XDocletException - Description of Exception

isDataObjectMethod

public static boolean isDataObjectMethod(com.sun.javadoc.MethodDoc method)
                                  throws XDocletException

getDataObjectClassFor

public static java.lang.String getDataObjectClassFor(com.sun.javadoc.ClassDoc clazz)
                                              throws XDocletException
Parameters:
clazz - Description of Parameter
Returns:
the full qualified data-object class name
Throws:
XDocletException - Description of Exception

getCurrentDataObjectClassname

public static java.lang.String getCurrentDataObjectClassname()
Returns:
the current data-object class name

isGenerationNeeded

public static boolean isGenerationNeeded(com.sun.javadoc.ClassDoc clazz)
                                  throws XDocletException
Returns true if ejb:data-object defined and generate param is true, false if not true.
Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

setCurrentDataObjectClassname

public static void setCurrentDataObjectClassname(java.lang.String current_data_object_classname)
Parameters:
current_data_object_classname -  

putDataObjectClassnames

public static void putDataObjectClassnames(java.lang.String name,
                                           java.lang.String value)
Parameters:
name - Description of Parameter
value - Description of Parameter

generateDataObjectClass

public static java.lang.String generateDataObjectClass(com.sun.javadoc.ClassDoc clazz)
                                                throws XDocletException
Used by dataMostSuperObjectClass() to get the data object's full qualified class name. If name and package parameters of ejb:data-object defined, theire values are used, otherwise defaults are used.
Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception
See Also:
dataMostSuperObjectClass()

hasCustomBulkData

public static boolean hasCustomBulkData(com.sun.javadoc.ClassDoc clazz)
                                 throws XDocletException
Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

getDataObjectClassPattern

protected static java.lang.String getDataObjectClassPattern()
Returns:
the data-object class pattern

hasDataEquals

protected static boolean hasDataEquals(com.sun.javadoc.ClassDoc clazz)
                                throws XDocletException
Parameters:
clazz -  
Returns:
True if there is a Data Container equals() needed because user set tag "data-equals" to true or ommitted it
Throws:
XDocletException - Description of Exception

isDataContentEquals

public void isDataContentEquals(java.lang.String pTemplate)
                         throws XDocletException
Parameters:
pTemplate - Description of Parameter
Throws:
XDocletException - Description of Exception

dataObjectClass

public java.lang.String dataObjectClass()
                                 throws XDocletException
Returns data-object class name for the bean.
Returns:
The data-object class name for the bean.
Throws:
XDocletException - Description of Exception

dataMostSuperObjectClass

public java.lang.String dataMostSuperObjectClass()
                                          throws XDocletException
Returns the data-object class name highest in the hierarchy of derived beans. Because of possible inheritance between entity bean, the type of the generated getData method must be the one of the most super class of the current entity bean. The current Data class must extend the corresponding super Data class.
Returns:
The data-object class name highest in the hierarchy of derived beans.
Throws:
XDocletException - Description of Exception

generateDataObjectClass

public java.lang.String generateDataObjectClass()
                                         throws XDocletException
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

ifIsWithDataMethod

public void ifIsWithDataMethod(java.lang.String pTemplate)
                        throws XDocletException
Evaluate the body block if ejb:data-object setdata="true". If not defined then default is true.
Parameters:
pTemplate - Description of Parameter
Throws:
XDocletException - Description of Exception
See Also:
ifIsWithDataContainer(java.lang.String)

ifIsWithDataContainer

public void ifIsWithDataContainer(java.lang.String pTemplate)
                           throws XDocletException
Evaluate the body block if ejb:data-object container="true". If not defined then default is true.
Parameters:
pTemplate - Description of Parameter
Throws:
XDocletException - Description of Exception

ifIsAggregate

public void ifIsAggregate(java.lang.String template)
                   throws XDocletException
Evaluate the body block if ejb:aggregate is defined for current getter method, denoting that the specified getter method returns an aggregated object.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
ifIsNotAggregate(java.lang.String), isAggregate(com.sun.javadoc.MethodDoc)

ifIsNotAggregate

public void ifIsNotAggregate(java.lang.String template)
                      throws XDocletException
Evaluate the body block if ejb:aggregate is not defined for current getter method.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
ifIsAggregate(java.lang.String), isAggregate(com.sun.javadoc.MethodDoc)

forAllSuperSetData

public void forAllSuperSetData(java.lang.String template)
                        throws XDocletException
Evaluates the body block for each setData method.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
forAllSuper(java.lang.String,java.lang.String)

parentDataObjectClass

public java.lang.String parentDataObjectClass()
                                       throws XDocletException
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

serialVersionUID

public java.lang.String serialVersionUID()
                                  throws XDocletException
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

extendsFrom

public java.lang.String extendsFrom()
                             throws XDocletException
Returns the name of the class dataobject class extends.
Returns:
The name of generated PK class.
Throws:
XDocletException - Description of Exception

dataObjectClassNameFromInterfaceName

public java.lang.String dataObjectClassNameFromInterfaceName()
                                                      throws XDocletException
Return the dataobject class name from interface name.
Returns:
the data-object class name
Throws:
XDocletException - Description of Exception

isAggregate

protected boolean isAggregate(com.sun.javadoc.MethodDoc method)
                       throws XDocletException
Returns true if method has ejb:aggregate, false otherwise.
Parameters:
method - Description of Parameter
Returns:
The Aggregate value
Throws:
XDocletException - Description of Exception

getDependentClassFor

protected java.lang.String getDependentClassFor(com.sun.javadoc.ClassDoc clazz,
                                                java.lang.String type)
                                         throws XDocletException
Description copied from class: EjbTagsHandler
sub-classes which deal with patternized class names return a reasonable value
Overrides:
getDependentClassFor in class EjbTagsHandler
Following copied from class: xdoclet.ejb.tags.EjbTagsHandler
Parameters:
clazz - the class
type - type value used for view-type of remote/local
Returns:
dependent class name for the class and type
Throws:
XDocletException -  

forAllSuper

protected void forAllSuper(java.lang.String template,
                           java.lang.String methodName)
                    throws XDocletException
Browse all super classes and search for a special method to generate it in the current CMP/BMP class.
Parameters:
template - The body of the block tag
methodName - Description of Parameter
Throws:
XDocletException - Description of Exception