xdoclet.modules.ejb.entity

Class ValueObjectTagsHandler


public class ValueObjectTagsHandler
extends EjbTagsHandler

Tags used by the Value Object templates.
Version:
$Revision: 1.28 $
Author:
Vincent Harcq (vincent.harcq@hubmethods.com)
xdoclet.taghandler
namespace = "EjbValueObj"
created
13. juni 2002

Method Summary

String
collectionType()
Returns the collection type for the current field.
String
concreteCollectionType()
Type of the constructor for aggregates or compositions.
String
currentAggregateName(Properties attributes)
Returns the current aggregate's name
String
currentAggregateType(Properties attributes)
Returns the class name of the current aggregate attribute's type.
String
currentRelationBeanClass()
Return the bean class name for the current relation.
String
currentValueObjectAttribute()
Return the current value object's attribute name.
String
currentValueObjectClass()
Return the current value object's class name.
String
currentValueObjectMatch()
Return the current value object's match parameter.
String
extendsFrom(Properties attributes)
Returns the name of the class the specified value object extends.
void
forAllAggregates(String template, Properties attributes)
Loop over all the aggregate fields in the given value object, and generate the body for each one.
void
forAllComposes(String template, Properties attributes)
Loop over all the composed fields in the given value object, and generate the body for each one.
void
forAllRelations(String template, Properties attributes)
Loop over all the relation fields in the given value object, and generate the body for each one.
protected void
forAllSetters(String template, String methodName)
void
forAllSuperSetValue(String template)
Describe what the method does
void
forAllValueObjects(String pTemplate)
Loops over all the ejb.value-object tags in the class, and generates the body for each one.
static String
getCurrentValueObjectAttribute(XTag tag)
Gets the CurrentValueObjectAttribute attribute of the ValueObjectTagsHandler class
static String
getCurrentValueObjectClass(XClass clazz, XTag tag)
Gets the CurrentValueObjectClass attribute of the ValueObjectTagsHandler class
static String
getCurrentValueObjectExtends(XTag tag)
static String
getCurrentValueObjectImplements(XTag tag)
static String
getCurrentValueObjectMatch(XTag tag)
Gets the CurrentValueObjectMatch attribute of the ValueObjectTagsHandler class
static String
getCurrentValueObjectName(XTag tag)
Gets the CurrentValueObjectName attribute of the ValueObjectTagsHandler class
String
getValueMostSuperObjectClass(XClass clazz)
void
ifGeneratePKConstructor(String template, Properties attributes)
Evaluates the body if the valueobject subtask's generatePKConstructor parameter is true.
void
ifIsAbstractValueObject(String template)
Evaluates the body if the abstract parameter is set to true on the ejb.value-object tag for the current VO.
void
ifIsCollection(String template)
Executes the body only if the current field is a collection.
void
ifIsNotCollection(String template)
Executes the body only if the current field is not a collection.
void
ifNotIsAbstractValueObject(String template)
Evaluates the body if the abstract parameter is set to false (or is missing) on the ejb.value-object tag for the current VO.
void
ifUsingValueObject(String template)
Evaluate the body block if Value Object subtask being used.
boolean
isAbstractValueObject(String valueObjectName, XClass currentClass)
Whether or not the abstract parameter is set to true on the supplied class' ejb.value-object tag for the given VO name.
static boolean
isGenerationNeeded(XClass clazz)
Gets the GenerationNeeded attribute of the ValueObjectTagsHandler class
static boolean
isValueObjectRelation(XMethod method, String valueObject)
Checks if a method is a value object relation (aggregate or compose) matching a certain valueObject
String
valueMostSuperObjectClass()
Returns the data-object class name highest in the hierarchy of derived beans.
String
valueObjectClass()
Return the current value object's class name.
String
valueObjectImplements()
return interfaces to be implemented
String
valueObjectMatch()
Return the current value object's match parameter.
String
valueObjectName()
Return the current value object's name.

Method Details

collectionType

public String collectionType()
            throws xdoclet.XDocletException
Returns the collection type for the current field.
Returns:
the type
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"

concreteCollectionType

public String concreteCollectionType()
            throws xdoclet.XDocletException
Type of the constructor for aggregates or compositions.
Returns:
Type of the constructor for aggregates or compositions.
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

currentAggregateName

public String currentAggregateName(Properties attributes)
Returns the current aggregate's name
Parameters:
attributes -
Returns:
aggregate name
doc.tag
type = "content"
doc.param
name = "plural" optional = "true" values = "true, false" default = "false" descriptions = "return the plural of the aggregate's name if set to true"
name = "decapitalize" optional = "true" values = "true, false" default = "false" descriptions = "return the decapitalize aggregate's name if set to true"

currentAggregateType

public String currentAggregateType(Properties attributes)
Returns the class name of the current aggregate attribute's type.
Parameters:
attributes - The attributes of the template tag
Returns:
class
doc.tag
type = "content"
doc.param
name = "short" description = "Use the short (not fully-qualified) class name."

currentRelationBeanClass

public String currentRelationBeanClass()
Return the bean class name for the current relation.
Returns:
class name
doc.tag
type = "content"

currentValueObjectAttribute

public String currentValueObjectAttribute()
Return the current value object's attribute name.
Returns:
attribute
doc.tag
type = "content"

currentValueObjectClass

public String currentValueObjectClass()
Return the current value object's class name.
Returns:
class name
doc.tag
type = "content"

currentValueObjectMatch

public String currentValueObjectMatch()
Return the current value object's match parameter.
Returns:
match value
doc.tag
type = "content"

extendsFrom

public String extendsFrom(Properties attributes)
            throws xdoclet.XDocletException
Returns the name of the class the specified value object extends. If no extends parameter exists on the ejb.value-object tag, java.lang.Object is returned.
Parameters:
attributes - The attributes of the template tag
Returns:
The name of generated PK class.
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"
doc.param
name = "valueobject" optional = "false" description = "The name of the value object to check."

forAllAggregates

public void forAllAggregates(String template,
                             Properties attributes)
            throws xdoclet.XDocletException
Loop over all the aggregate fields in the given value object, and generate the body for each one.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"
doc.param
name = "superclasses" values = "true,false" description = "Whether to include fields in superclasses."
name = "valueobject" optional = "false" description = "The value object name."

forAllComposes

public void forAllComposes(String template,
                           Properties attributes)
            throws xdoclet.XDocletException
Loop over all the composed fields in the given value object, and generate the body for each one.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"
doc.param
name = "superclasses" values = "true,false" description = "Whether to include fields in superclasses."
name = "valueobject" optional = "false" description = "The value object name."

forAllRelations

public void forAllRelations(String template,
                            Properties attributes)
            throws xdoclet.XDocletException
Loop over all the relation fields in the given value object, and generate the body for each one.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"
doc.param
name = "superclasses" values = "true,false" description = "Whether to include fields in superclasses."
name = "valueobject" optional = "false" description = "The value object name."

forAllSetters

protected void forAllSetters(String template,
                             String methodName)
            throws xdoclet.XDocletException

forAllSuperSetValue

public void forAllSuperSetValue(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

forAllValueObjects

public void forAllValueObjects(String pTemplate)
            throws xdoclet.XDocletException
Loops over all the ejb.value-object tags in the class, and generates the body for each one.
Parameters:
pTemplate - The body of the block tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

getCurrentValueObjectAttribute

public static String getCurrentValueObjectAttribute(XTag tag)
            throws xdoclet.XDocletException
Gets the CurrentValueObjectAttribute attribute of the ValueObjectTagsHandler class
Parameters:
tag - Describe what the parameter does
Returns:
The CurrentValueObjectAttribute value
Throws:
xdoclet.XDocletException -

getCurrentValueObjectClass

public static String getCurrentValueObjectClass(XClass clazz,
                                                XTag tag)
            throws xdoclet.XDocletException
Gets the CurrentValueObjectClass attribute of the ValueObjectTagsHandler class
Parameters:
clazz - Describe what the parameter does
tag - Describe what the parameter does
Returns:
The CurrentValueObjectClass value
Throws:
xdoclet.XDocletException -

getCurrentValueObjectExtends

public static String getCurrentValueObjectExtends(XTag tag)

getCurrentValueObjectImplements

public static String getCurrentValueObjectImplements(XTag tag)

getCurrentValueObjectMatch

public static String getCurrentValueObjectMatch(XTag tag)
Gets the CurrentValueObjectMatch attribute of the ValueObjectTagsHandler class
Parameters:
tag - Describe what the parameter does
Returns:
The CurrentValueObjectMatch value

getCurrentValueObjectName

public static String getCurrentValueObjectName(XTag tag)
            throws xdoclet.XDocletException
Gets the CurrentValueObjectName attribute of the ValueObjectTagsHandler class
Parameters:
tag - Describe what the parameter does
Returns:
The CurrentValueObjectName value
Throws:
xdoclet.XDocletException -

getValueMostSuperObjectClass

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

ifGeneratePKConstructor

public void ifGeneratePKConstructor(String template,
                                    Properties attributes)
            throws xdoclet.XDocletException
Evaluates the body if the valueobject subtask's generatePKConstructor parameter is true.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifIsAbstractValueObject

public void ifIsAbstractValueObject(String template)
            throws xdoclet.XDocletException
Evaluates the body if the abstract parameter is set to true on the ejb.value-object tag for the current VO.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifIsCollection

public void ifIsCollection(String template)
            throws xdoclet.XDocletException
Executes the body only if the current field is a collection.
Parameters:
template - the template
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"

ifIsNotCollection

public void ifIsNotCollection(String template)
            throws xdoclet.XDocletException
Executes the body only if the current field is not a collection.
Parameters:
template - the template
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"

ifNotIsAbstractValueObject

public void ifNotIsAbstractValueObject(String template)
            throws xdoclet.XDocletException
Evaluates the body if the abstract parameter is set to false (or is missing) on the ejb.value-object tag for the current VO.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifUsingValueObject

public void ifUsingValueObject(String template)
            throws xdoclet.XDocletException
Evaluate the body block if Value Object subtask being used.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

isAbstractValueObject

public boolean isAbstractValueObject(String valueObjectName,
                                     XClass currentClass)
            throws xdoclet.XDocletException
Whether or not the abstract parameter is set to true on the supplied class' ejb.value-object tag for the given VO name.
Parameters:
valueObjectName -
currentClass -
Returns:
Throws:
xdoclet.XDocletException -

isGenerationNeeded

public static boolean isGenerationNeeded(XClass clazz)
Gets the GenerationNeeded attribute of the ValueObjectTagsHandler class
Parameters:
clazz - Describe what the parameter does
Returns:
The GenerationNeeded value

isValueObjectRelation

public static boolean isValueObjectRelation(XMethod method,
                                            String valueObject)
Checks if a method is a value object relation (aggregate or compose) matching a certain valueObject
Parameters:
method -
valueObject -
Returns:

valueMostSuperObjectClass

public String valueMostSuperObjectClass()
            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"

valueObjectClass

public String valueObjectClass()
            throws xdoclet.XDocletException
Return the current value object's class name.
Returns:
class name
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

valueObjectImplements

public String valueObjectImplements()
return interfaces to be implemented
Returns:
interfaces
doc.tag
type = "content"

valueObjectMatch

public String valueObjectMatch()
            throws xdoclet.XDocletException
Return the current value object's match parameter.
Returns:
match value
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

valueObjectName

public String valueObjectName()
            throws xdoclet.XDocletException
Return the current value object's name.
Returns:
VO name
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"