xdoclet.modules.ejb.entity

Class 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

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(XClass clazz)
Used by dataMostSuperObjectClass() to get the data object's full qualified class name.
static String
getCurrentDataObjectClassname()
static String
getDataMostSuperObjectClass(XClass clazz)
static String
getDataObjectClassFor(XClass clazz)
protected static String
getDataObjectClassPattern()
protected String
getDependentClassFor(XClass clazz, String type)
Gets the DependentClassFor attribute of the DataObjectTagsHandler object
static boolean
hasCustomBulkData(XClass clazz)
protected static boolean
hasDataEquals(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(XMethod method)
Returns true if method has ejb:aggregate, false otherwise.
void
isDataContentEquals(String pTemplate)
static boolean
isDataObjectMethod(XMethod method)
Gets the DataObjectMethod attribute of the DataObjectTagsHandler class
static boolean
isGenerationNeeded(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)

Field Details

currentDataObjectClassname

protected static String currentDataObjectClassname

dataObjectClassnames

protected static HashMap dataObjectClassnames

Method Details

dataMostSuperObjectClass

public String dataMostSuperObjectClass()
            throws xdoclet.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:
xdoclet.XDocletException -
doc.tag
type = "content"

dataObjectClass

public String dataObjectClass()
            throws xdoclet.XDocletException
Returns data-object class name for the bean.
Returns:
The data-object class name for the bean.
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

dataObjectClassNameFromInterfaceName

public String dataObjectClassNameFromInterfaceName()
            throws xdoclet.XDocletException
Return the dataobject class name from interface name.
Returns:
the data-object class name
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

extendsFrom

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

forAllSuper

protected void forAllSuper(String template,
                           String methodName)
            throws xdoclet.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:
xdoclet.XDocletException -

forAllSuperSetData

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

generateDataObjectClass

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

generateDataObjectClass

public static String generateDataObjectClass(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

getCurrentDataObjectClassname

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

getDataMostSuperObjectClass

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

getDataObjectClassFor

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

getDataObjectClassPattern

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

getDependentClassFor

protected String getDependentClassFor(XClass clazz,
                                      String type)
            throws xdoclet.XDocletException
Gets the DependentClassFor attribute of the DataObjectTagsHandler object
Parameters:
clazz - Describe what the parameter does
type - Describe what the parameter does
Returns:
The DependentClassFor value
Throws:
xdoclet.XDocletException -

hasCustomBulkData

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

hasDataEquals

protected static boolean hasDataEquals(XClass clazz)
            throws xdoclet.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:
xdoclet.XDocletException -

ifIsAggregate

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

ifIsNotAggregate

public void ifIsNotAggregate(String template)
            throws xdoclet.XDocletException
Evaluate the body block if ejb:aggregate is not defined for current getter method.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
ifIsAggregate(java.lang.String), isAggregate(xjavadoc.XMethod)
doc.tag
type = "block"

ifIsWithDataContainer

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

ifIsWithDataMethod

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

isAggregate

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

isDataContentEquals

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

isDataObjectMethod

public static boolean isDataObjectMethod(XMethod method)
            throws xdoclet.XDocletException
Gets the DataObjectMethod attribute of the DataObjectTagsHandler class
Parameters:
method - Describe what the parameter does
Returns:
The DataObjectMethod value
Throws:
xdoclet.XDocletException -

isGenerationNeeded

public static boolean isGenerationNeeded(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

parentDataObjectClass

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

putDataObjectClassnames

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

setCurrentDataObjectClassname

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