xdoclet.modules.ejb.entity
Class DataObjectTagsHandler

java.lang.Object
  extended byxdoclet.template.TemplateTagHandler
      extended byxdoclet.XDocletTagSupport
          extended byxdoclet.modules.ejb.EjbTagsHandler
              extended byxdoclet.modules.ejb.entity.DataObjectTagsHandler

public class DataObjectTagsHandler
extends EjbTagsHandler

Version:
$Revision: 1.12 $
Author:
Ara Abrahamian (ara_e@email.com)
xdoclet.taghandler
namespace="EjbDataObj"
created
13. juni 2002

Field Summary
protected static String currentDataObjectClassname
           
protected static HashMap dataObjectClassnames
           
 
Fields inherited from class xdoclet.modules.ejb.EjbTagsHandler
ALL, LOCAL_SUFFIX, SERVICE_ENDPOINT, SERVICE_ENDPOINT_SUFFIX
 
Fields inherited from class xdoclet.XDocletTagSupport
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
 
Constructor Summary
DataObjectTagsHandler()
           
 
Method Summary
 String dataMostSuperObjectClass()
          Returns the data-object class name highest in the hierarchy of derived beans.
 String dataObjectClass()
          Returns data-object class name for the bean.
 String dataObjectClassNameFromInterfaceName()
          Return the dataobject class name from interface name.
 String extendsFrom()
          Returns the name of the class dataobject class extends.
protected  void forAllSuper(String template, String methodName)
          Browse all super classes and search for a special method to generate it in the current CMP/BMP class.
 void forAllSuperSetData(String template)
          Evaluates the body block for each setData method.
 String generateDataObjectClass()
           
static String generateDataObjectClass(xjavadoc.XClass clazz)
          Used by dataMostSuperObjectClass() to get the data object's full qualified class name.
static String getCurrentDataObjectClassname()
           
static String getDataMostSuperObjectClass(xjavadoc.XClass clazz)
           
static String getDataObjectClassFor(xjavadoc.XClass clazz)
           
protected static String getDataObjectClassPattern()
           
protected  String getDependentClassFor(xjavadoc.XClass clazz, String type)
          Gets the DependentClassFor attribute of the DataObjectTagsHandler object
static boolean hasCustomBulkData(xjavadoc.XClass clazz)
           
protected static boolean hasDataEquals(xjavadoc.XClass clazz)
           
 void ifIsAggregate(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(String template)
          Evaluate the body block if ejb:aggregate is not defined for current getter method.
 void ifIsWithDataContainer(String pTemplate)
          Evaluate the body block if ejb:data-object container="true".
 void ifIsWithDataMethod(String pTemplate)
          Evaluate the body block if ejb:data-object setdata="true".
protected  boolean isAggregate(xjavadoc.XMethod method)
          Returns true if method has ejb:aggregate, false otherwise.
 void isDataContentEquals(String pTemplate)
           
static boolean isDataObjectMethod(xjavadoc.XMethod method)
          Gets the DataObjectMethod attribute of the DataObjectTagsHandler class
static boolean isGenerationNeeded(xjavadoc.XClass clazz)
          Returns true if ejb:data-object defined and generate param is true, false if not true.
 String parentDataObjectClass()
           
static void putDataObjectClassnames(String name, String value)
           
static void setCurrentDataObjectClassname(String current_data_object_classname)
           
 
Methods inherited from class xdoclet.modules.ejb.EjbTagsHandler
beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, ejbRefName, extendsFromFor, forAllBeans, getDependentClassTagName, getEjb, getEjbIdFor, getEjbNameFor, getEjbSpec, getShortEjbNameFor, hasTransaction, id, ifIsAConcreteEJBean, ifLocalEjb, ifNotLocalEjb, ifNotRemoteEjb, ifNotServiceEndpointEjb, ifRemoteEjb, ifServiceEndpointEjb, isAConcreteEJBean, isEjb, isLocalEjb, isOnlyLocalEjb, isOnlyRemoteEjb, isOnlyServiceEndpointEjb, isRemoteEjb, isServiceEndpointEjb, prefixWithEjbSlash, shortEjbName, shouldTraverseSuperclassForDependentClass, symbolicClassName
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataObjectClassnames

protected static HashMap dataObjectClassnames

currentDataObjectClassname

protected static String currentDataObjectClassname
Constructor Detail

DataObjectTagsHandler

public DataObjectTagsHandler()
Method Detail

getDataMostSuperObjectClass

public static String getDataMostSuperObjectClass(xjavadoc.XClass clazz)
                                          throws XDocletException
Parameters:
clazz - Description of Parameter
Returns:
the full qualified data-object class name
Throws:
XDocletException

isDataObjectMethod

public static boolean isDataObjectMethod(xjavadoc.XMethod method)
                                  throws XDocletException
Gets the DataObjectMethod attribute of the DataObjectTagsHandler class

Parameters:
method - Describe what the parameter does
Returns:
The DataObjectMethod value
Throws:
XDocletException

getDataObjectClassFor

public static String getDataObjectClassFor(xjavadoc.XClass clazz)
Parameters:
clazz - Description of Parameter
Returns:
the full qualified data-object class name

getCurrentDataObjectClassname

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

isGenerationNeeded

public static boolean isGenerationNeeded(xjavadoc.XClass clazz)
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

setCurrentDataObjectClassname

public static void setCurrentDataObjectClassname(String current_data_object_classname)
Parameters:
current_data_object_classname -

putDataObjectClassnames

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

generateDataObjectClass

public static String generateDataObjectClass(xjavadoc.XClass clazz)
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
See Also:
dataMostSuperObjectClass()

hasCustomBulkData

public static boolean hasCustomBulkData(xjavadoc.XClass clazz)
Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value

getDataObjectClassPattern

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

hasDataEquals

protected static boolean hasDataEquals(xjavadoc.XClass 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

isDataContentEquals

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

dataObjectClass

public String dataObjectClass()
                       throws XDocletException
Returns data-object class name for the bean.

Returns:
The data-object class name for the bean.
Throws:
XDocletException
doc.tag
type="content"

dataMostSuperObjectClass

public 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
doc.tag
type="content"

generateDataObjectClass

public String generateDataObjectClass()
                               throws XDocletException
Returns:
Description of the Returned Value
Throws:
XDocletException
doc.tag
type="content"

ifIsWithDataMethod

public void ifIsWithDataMethod(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
See Also:
ifIsWithDataContainer(java.lang.String)
doc.tag
type="block"

ifIsWithDataContainer

public void ifIsWithDataContainer(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
doc.tag
type="block"

ifIsAggregate

public void ifIsAggregate(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
See Also:
ifIsNotAggregate(java.lang.String), isAggregate(xjavadoc.XMethod)
doc.tag
type="block"

ifIsNotAggregate

public void ifIsNotAggregate(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
See Also:
ifIsAggregate(java.lang.String), isAggregate(xjavadoc.XMethod)
doc.tag
type="block"

forAllSuperSetData

public void forAllSuperSetData(String template)
                        throws XDocletException
Evaluates the body block for each setData method.

Parameters:
template - The body of the block tag
Throws:
XDocletException
See Also:
forAllSuper(java.lang.String,java.lang.String)
doc.tag
type="block"

parentDataObjectClass

public String parentDataObjectClass()
                             throws XDocletException
Returns:
Description of the Returned Value
Throws:
XDocletException

extendsFrom

public String extendsFrom()
                   throws XDocletException
Returns the name of the class dataobject class extends.

Returns:
The name of generated PK class.
Throws:
XDocletException
doc.tag
type="content"

dataObjectClassNameFromInterfaceName

public String dataObjectClassNameFromInterfaceName()
                                            throws XDocletException
Return the dataobject class name from interface name.

Returns:
the data-object class name
Throws:
XDocletException
doc.tag
type="content"

isAggregate

protected boolean isAggregate(xjavadoc.XMethod method)
                       throws XDocletException
Returns true if method has ejb:aggregate, false otherwise.

Parameters:
method - Description of Parameter
Returns:
The Aggregate value
Throws:
XDocletException

getDependentClassFor

protected String getDependentClassFor(xjavadoc.XClass clazz,
                                      String type)
                               throws XDocletException
Gets the DependentClassFor attribute of the DataObjectTagsHandler object

Overrides:
getDependentClassFor in class EjbTagsHandler
Parameters:
clazz - Describe what the parameter does
type - Describe what the parameter does
Returns:
The DependentClassFor value
Throws:
XDocletException

forAllSuper

protected void forAllSuper(String template,
                           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

http://xdoclet.sourceforge.net/