xdoclet.modules.ejb.entity
Class ValueObjectTagsHandler

java.lang.Object
  extended by xdoclet.template.TemplateTagHandler
      extended by xdoclet.XDocletTagSupport
          extended by xdoclet.modules.ejb.EjbTagsHandler
              extended by xdoclet.modules.ejb.entity.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

Field Summary
 
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
ValueObjectTagsHandler()
           
 
Method Summary
 java.lang.String collectionType()
          Returns the collection type for the current field.
 java.lang.String concreteCollectionType()
          Type of the constructor for aggregates or compositions.
 java.lang.String currentAggregateName(java.util.Properties attributes)
          Returns the current aggregate's name
 java.lang.String currentAggregateType(java.util.Properties attributes)
          Returns the class name of the current aggregate attribute's type.
 java.lang.String currentRelationBeanClass()
          Return the bean class name for the current relation.
 java.lang.String currentValueObjectAttribute()
          Return the current value object's attribute name.
 java.lang.String currentValueObjectClass()
          Return the current value object's class name.
 java.lang.String currentValueObjectMatch()
          Return the current value object's match parameter.
 java.lang.String extendsFrom(java.util.Properties attributes)
          Returns the name of the class the specified value object extends.
 void forAllAggregates(java.lang.String template, java.util.Properties attributes)
          Loop over all the aggregate fields in the given value object, and generate the body for each one.
 void forAllComposes(java.lang.String template, java.util.Properties attributes)
          Loop over all the composed fields in the given value object, and generate the body for each one.
 void forAllRelations(java.lang.String template, java.util.Properties attributes)
          Loop over all the relation fields in the given value object, and generate the body for each one.
protected  void forAllSetters(java.lang.String template, java.lang.String methodName)
           
 void forAllSuperSetValue(java.lang.String template)
          Describe what the method does
 void forAllValueObjects(java.lang.String pTemplate)
          Loops over all the ejb.value-object tags in the class, and generates the body for each one.
static java.lang.String getCurrentValueObjectAttribute(xjavadoc.XTag tag)
          Gets the CurrentValueObjectAttribute attribute of the ValueObjectTagsHandler class
static java.lang.String getCurrentValueObjectClass(xjavadoc.XClass clazz, xjavadoc.XTag tag)
          Gets the CurrentValueObjectClass attribute of the ValueObjectTagsHandler class
static java.lang.String getCurrentValueObjectExtends(xjavadoc.XTag tag)
           
static java.lang.String getCurrentValueObjectImplements(xjavadoc.XTag tag)
           
static java.lang.String getCurrentValueObjectMatch(xjavadoc.XTag tag)
          Gets the CurrentValueObjectMatch attribute of the ValueObjectTagsHandler class
static java.lang.String getCurrentValueObjectName(xjavadoc.XTag tag)
          Gets the CurrentValueObjectName attribute of the ValueObjectTagsHandler class
 java.lang.String getValueMostSuperObjectClass(xjavadoc.XClass clazz)
           
 void ifGeneratePKConstructor(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if the valueobject subtask's generatePKConstructor parameter is true.
 void ifIsAbstractValueObject(java.lang.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(java.lang.String template)
          Executes the body only if the current field is a collection.
 void ifIsNotCollection(java.lang.String template)
          Executes the body only if the current field is not a collection.
 void ifNotIsAbstractValueObject(java.lang.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(java.lang.String template)
          Evaluate the body block if Value Object subtask being used.
 boolean isAbstractValueObject(java.lang.String valueObjectName, xjavadoc.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(xjavadoc.XClass clazz)
          Gets the GenerationNeeded attribute of the ValueObjectTagsHandler class
static boolean isValueObjectRelation(xjavadoc.XMethod method, java.lang.String valueObject)
          Checks if a method is a value object relation (aggregate or compose) matching a certain valueObject
 java.lang.String valueMostSuperObjectClass()
          Returns the data-object class name highest in the hierarchy of derived beans.
 java.lang.String valueObjectClass()
          Return the current value object's class name.
 java.lang.String valueObjectImplements()
          return interfaces to be implemented
 java.lang.String valueObjectMatch()
          Return the current value object's match parameter.
 java.lang.String valueObjectName()
          Return the current value object's name.
 
Methods inherited from class xdoclet.modules.ejb.EjbTagsHandler
beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, ejbRefName, extendsFromFor, forAllBeans, getDependentClassFor, 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
 

Constructor Detail

ValueObjectTagsHandler

public ValueObjectTagsHandler()
Method Detail

isValueObjectRelation

public static boolean isValueObjectRelation(xjavadoc.XMethod method,
                                            java.lang.String valueObject)
Checks if a method is a value object relation (aggregate or compose) matching a certain valueObject

Parameters:
method -
valueObject -
Returns:

isGenerationNeeded

public static boolean isGenerationNeeded(xjavadoc.XClass clazz)
Gets the GenerationNeeded attribute of the ValueObjectTagsHandler class

Parameters:
clazz - Describe what the parameter does
Returns:
The GenerationNeeded value

getCurrentValueObjectClass

public static java.lang.String getCurrentValueObjectClass(xjavadoc.XClass clazz,
                                                          xjavadoc.XTag tag)
                                                   throws 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:
XDocletException

getCurrentValueObjectName

public static java.lang.String getCurrentValueObjectName(xjavadoc.XTag tag)
                                                  throws XDocletException
Gets the CurrentValueObjectName attribute of the ValueObjectTagsHandler class

Parameters:
tag - Describe what the parameter does
Returns:
The CurrentValueObjectName value
Throws:
XDocletException

getCurrentValueObjectAttribute

public static java.lang.String getCurrentValueObjectAttribute(xjavadoc.XTag tag)
                                                       throws XDocletException
Gets the CurrentValueObjectAttribute attribute of the ValueObjectTagsHandler class

Parameters:
tag - Describe what the parameter does
Returns:
The CurrentValueObjectAttribute value
Throws:
XDocletException

getCurrentValueObjectMatch

public static java.lang.String getCurrentValueObjectMatch(xjavadoc.XTag tag)
Gets the CurrentValueObjectMatch attribute of the ValueObjectTagsHandler class

Parameters:
tag - Describe what the parameter does
Returns:
The CurrentValueObjectMatch value

getCurrentValueObjectImplements

public static java.lang.String getCurrentValueObjectImplements(xjavadoc.XTag tag)

getCurrentValueObjectExtends

public static java.lang.String getCurrentValueObjectExtends(xjavadoc.XTag tag)

isAbstractValueObject

public boolean isAbstractValueObject(java.lang.String valueObjectName,
                                     xjavadoc.XClass currentClass)
                              throws 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:
XDocletException

getValueMostSuperObjectClass

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

ifGeneratePKConstructor

public void ifGeneratePKConstructor(java.lang.String template,
                                    java.util.Properties attributes)
                             throws 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:
XDocletException
doc.tag
type = "block"

ifIsAbstractValueObject

public void ifIsAbstractValueObject(java.lang.String template)
                             throws 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:
XDocletException
doc.tag
type = "block"

ifNotIsAbstractValueObject

public void ifNotIsAbstractValueObject(java.lang.String template)
                                throws 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:
XDocletException
doc.tag
type = "block"

valueObjectClass

public java.lang.String valueObjectClass()
                                  throws XDocletException
Return the current value object's class name.

Returns:
class name
Throws:
XDocletException
doc.tag
type = "content"

valueObjectName

public java.lang.String valueObjectName()
                                 throws XDocletException
Return the current value object's name.

Returns:
VO name
Throws:
XDocletException
doc.tag
type = "content"

valueObjectMatch

public java.lang.String valueObjectMatch()
                                  throws XDocletException
Return the current value object's match parameter.

Returns:
match value
Throws:
XDocletException
doc.tag
type = "content"

extendsFrom

public java.lang.String extendsFrom(java.util.Properties attributes)
                             throws 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:
XDocletException
doc.tag
type = "content"
doc.param
name = "valueobject" optional = "false" description = "The name of the value object to * check."

forAllValueObjects

public void forAllValueObjects(java.lang.String pTemplate)
                        throws 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:
XDocletException
doc.tag
type = "block"

currentValueObjectClass

public java.lang.String currentValueObjectClass()
Return the current value object's class name.

Returns:
class name
doc.tag
type = "content"

currentValueObjectAttribute

public java.lang.String currentValueObjectAttribute()
Return the current value object's attribute name.

Returns:
attribute
doc.tag
type = "content"

currentValueObjectMatch

public java.lang.String currentValueObjectMatch()
Return the current value object's match parameter.

Returns:
match value
doc.tag
type = "content"

currentAggregateType

public java.lang.String currentAggregateType(java.util.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."

valueObjectImplements

public java.lang.String valueObjectImplements()
return interfaces to be implemented

Returns:
interfaces
doc.tag
type = "content"

currentAggregateName

public java.lang.String currentAggregateName(java.util.Properties attributes)
Returns the current aggregate's name

Parameters:
attributes -
Returns:
aggregate name
Throws:
XDocletException - if an error occures
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"

currentRelationBeanClass

public java.lang.String currentRelationBeanClass()
Return the bean class name for the current relation.

Returns:
class name
doc.tag
type = "content"

concreteCollectionType

public java.lang.String concreteCollectionType()
                                        throws XDocletException
Type of the constructor for aggregates or compositions.

Returns:
Type of the constructor for aggregates or compositions.
Throws:
XDocletException
doc.tag
type = "content"

collectionType

public java.lang.String collectionType()
                                throws XDocletException
Returns the collection type for the current field.

Returns:
the type
Throws:
XDocletException - if an error occures
doc.tag
type = "content"

ifIsCollection

public void ifIsCollection(java.lang.String template)
                    throws XDocletException
Executes the body only if the current field is a collection.

Parameters:
template - the template
Throws:
XDocletException - if an error occures
doc.tag
type = "block"

ifIsNotCollection

public void ifIsNotCollection(java.lang.String template)
                       throws XDocletException
Executes the body only if the current field is not a collection.

Parameters:
template - the template
Throws:
XDocletException - if an error occures
doc.tag
type = "block"

valueMostSuperObjectClass

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

forAllSuperSetValue

public void forAllSuperSetValue(java.lang.String template)
                         throws XDocletException
Describe what the method does

Parameters:
template - The body of the block tag
Throws:
XDocletException
doc.tag
type = "block"

forAllAggregates

public void forAllAggregates(java.lang.String template,
                             java.util.Properties attributes)
                      throws 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:
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(java.lang.String template,
                           java.util.Properties attributes)
                    throws 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:
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(java.lang.String template,
                            java.util.Properties attributes)
                     throws 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:
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."

ifUsingValueObject

public void ifUsingValueObject(java.lang.String template)
                        throws XDocletException
Evaluate the body block if Value Object subtask being used.

Parameters:
template - The body of the block tag
Throws:
XDocletException
doc.tag
type = "block"

forAllSetters

protected void forAllSetters(java.lang.String template,
                             java.lang.String methodName)
                      throws XDocletException
Throws:
XDocletException

http://xdoclet.sourceforge.net/