xdoclet.modules.ejb.dd

Class RelationTagsHandler


public class RelationTagsHandler
extends EjbTagsHandler

Version:
$Revision: 1.12 $
Authors:
Aslak Hellesxy
Ara Abrahamian (ara_e@email.com)
xdoclet.taghandler
namespace = "EjbRel"
created
Oct 15, 2001

Nested Class Summary

class
RelationTagsHandler.RelationHolder
Holds class/method of the two end points of a relationship.

Field Summary

protected static RelationTagsHandler.RelationHolder
currentRelation
The current relation, set by forAllRelationships and used by forAllRelationshipRoles.
protected static Map
relationMap
A map containing all relations.

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

Method Summary

void
forAllRelationships(String template)
Evaluates the body block for each relationship.
protected boolean
hasRelationships()
void
ifHasLeftRoleName(String template)
Describe what the method does
void
ifHasRelationships(String template)
Evaluates the body if at least one of the classes has an ejb:relation tag, otherwise not.
void
ifHasRightRoleName(String template)
Describe what the method does
void
ifIsBidirectional(String template)
Describe what the method does
void
ifIsLeftMany(String template)
Describe what the method does
void
ifIsMany2Many(String template)
Evaluates the body block if the current relationship is a many to many type, meaning, both sides of the relation returns java.util.Collection or java.util.Set.
void
ifIsNotACollection(String template)
Evaluates the body block if current method's return type is not a java.util.Collection or java.util.Set.
void
ifIsOne2Many(String template)
Evaluates the body block if the current relationship is a one to many type, meaning, ONLY ONE side of the relation returns java.util.Collection or java.util.Set.
void
ifIsOne2One(String template)
Evaluates the body block if the current relationship is a one to one type, meaning, neither side of the relation returns java.util.Collection or java.util.Set.
void
ifIsRightMany(String template)
Describe what the method does
void
ifIsUnidirectional(String template)
Describe what the method does
void
ifLeftCascadeDelete(String template)
Evaluates the body if the left side of this relation has cascade-delete=yes
void
ifLeftNavigable(String template)
Describe what the method does
void
ifNotHasRelationships(String template)
Evaluates the body if none of the classes has an ejb:relation tag, otherwise not.
void
ifNotIsMany2Many(String template)
Evaluates the body block if the current relationship IS NOT a many to many type, meaning, at least one side of the relation does not return java.util.Collection or java.util.Set.
void
ifNotIsOne2Many(String template)
Evaluates the body block if the current relationship IS NOT a one to many type, meaning, either both sides, or neither side of the relation returns java.util.Collection or java.util.Set.
void
ifNotIsOne2One(String template)
Evaluates the body block if the current relationship IS NOT a one to one type, meaning, at least one side of the relation returns java.util.Collection or java.util.Set.
void
ifRightCascadeDelete(String template)
Evaluates the body if the right side of this relation has cascade-delete=yes, or the left side has target-relation cascade-delete="yes"
void
ifRightNavigable(String template)
Describe what the method does
protected boolean
isSetOrCollection(String type)
Returns true if current method's return type is a java.util.Collection or java.util.Set, false otherwise.
String
leftEJBName()
Returns the EJB Name of the left side of this relationship
String
leftFieldName()
Describe what the method does
String
leftFieldType()
Describe what the method does
String
leftMultiplicity()
Describe what the method does
String
leftRoleName()
Describe what the method does
String
relationComment()
Describe what the method does
String
relationName()
String
rightEJBName()
Returns the EJB Name of the right side of this relationship
String
rightFieldName()
Describe what the method does
String
rightFieldType()
Describe what the method does
String
rightMultiplicity()
Describe what the method does
String
rightRoleName()
Describe what the method does

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

Field Details

currentRelation

protected static RelationTagsHandler.RelationHolder currentRelation
The current relation, set by forAllRelationships and used by forAllRelationshipRoles. It somehow is like the current index for the forAllRelationships loop.
See Also:
forAllRelationships(java.lang.String)

relationMap

protected static Map relationMap
A map containing all relations.

Method Details

forAllRelationships

public void forAllRelationships(String template)
            throws xdoclet.XDocletException
Evaluates the body block for each relationship. Relations are denoted by ejb:relation for the getter method of the cmr-field.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
xdoclet.modules.ejb.entity.CmpTagsHandler.isEntityCmp(xjavadoc.XClass), xdoclet.modules.ejb.entity.PersistentTagsHandler.isPersistentField(xjavadoc.XMethod), xdoclet.tagshandler.MethodTagsHandler.isGetter(java.lang.String), isSetOrCollection(java.lang.String)
doc.tag
type = "block"

hasRelationships

protected boolean hasRelationships()

ifHasLeftRoleName

public void ifHasLeftRoleName(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - Describe what the parameter does
Throws:
xdoclet.XDocletException -

ifHasRelationships

public void ifHasRelationships(String template)
            throws xdoclet.XDocletException
Evaluates the body if at least one of the classes has an ejb:relation tag, otherwise not.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -

ifHasRightRoleName

public void ifHasRightRoleName(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - Describe what the parameter does
Throws:
xdoclet.XDocletException -

ifIsBidirectional

public void ifIsBidirectional(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - Describe what the parameter does
Throws:
xdoclet.XDocletException -

ifIsLeftMany

public void ifIsLeftMany(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - Describe what the parameter does
Throws:
xdoclet.XDocletException -

ifIsMany2Many

public void ifIsMany2Many(String template)
            throws xdoclet.XDocletException
Evaluates the body block if the current relationship is a many to many type, meaning, both sides of the relation returns java.util.Collection or java.util.Set. Used by forAllRelationships.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
forAllRelationships(java.lang.String)
doc.tag
type = "block"

ifIsNotACollection

public void ifIsNotACollection(String template)
            throws xdoclet.XDocletException
Evaluates the body block if current method's return type is not a java.util.Collection or java.util.Set. Used by forAllRelationships.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
forAllRelationships(java.lang.String)
doc.tag
type = "block"

ifIsOne2Many

public void ifIsOne2Many(String template)
            throws xdoclet.XDocletException
Evaluates the body block if the current relationship is a one to many type, meaning, ONLY ONE side of the relation returns java.util.Collection or java.util.Set. Used by forAllRelationships.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
forAllRelationships(java.lang.String)
doc.tag
type = "block"

ifIsOne2One

public void ifIsOne2One(String template)
            throws xdoclet.XDocletException
Evaluates the body block if the current relationship is a one to one type, meaning, neither side of the relation returns java.util.Collection or java.util.Set. Used by forAllRelationships.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
forAllRelationships(java.lang.String)
doc.tag
type = "block"

ifIsRightMany

public void ifIsRightMany(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - Describe what the parameter does
Throws:
xdoclet.XDocletException -

ifIsUnidirectional

public void ifIsUnidirectional(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - Describe what the parameter does
Throws:
xdoclet.XDocletException -

ifLeftCascadeDelete

public void ifLeftCascadeDelete(String template)
            throws xdoclet.XDocletException
Evaluates the body if the left side of this relation has cascade-delete=yes
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -

ifLeftNavigable

public void ifLeftNavigable(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - Describe what the parameter does
Throws:
xdoclet.XDocletException -

ifNotHasRelationships

public void ifNotHasRelationships(String template)
            throws xdoclet.XDocletException
Evaluates the body if none of the classes has an ejb:relation tag, otherwise not.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -

ifNotIsMany2Many

public void ifNotIsMany2Many(String template)
            throws xdoclet.XDocletException
Evaluates the body block if the current relationship IS NOT a many to many type, meaning, at least one side of the relation does not return java.util.Collection or java.util.Set. Used by forAllRelationships.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
forAllRelationships(java.lang.String)
doc.tag
type = "block"

ifNotIsOne2Many

public void ifNotIsOne2Many(String template)
            throws xdoclet.XDocletException
Evaluates the body block if the current relationship IS NOT a one to many type, meaning, either both sides, or neither side of the relation returns java.util.Collection or java.util.Set. Used by forAllRelationships.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
forAllRelationships(java.lang.String)
doc.tag
type = "block"

ifNotIsOne2One

public void ifNotIsOne2One(String template)
            throws xdoclet.XDocletException
Evaluates the body block if the current relationship IS NOT a one to one type, meaning, at least one side of the relation returns java.util.Collection or java.util.Set. Used by forAllRelationships.
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -
See Also:
forAllRelationships(java.lang.String)
doc.tag
type = "block"

ifRightCascadeDelete

public void ifRightCascadeDelete(String template)
            throws xdoclet.XDocletException
Evaluates the body if the right side of this relation has cascade-delete=yes, or the left side has target-relation cascade-delete="yes"
Parameters:
template - The body of the block tag
Throws:
xdoclet.XDocletException -

ifRightNavigable

public void ifRightNavigable(String template)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
template - Describe what the parameter does
Throws:
xdoclet.XDocletException -

isSetOrCollection

protected boolean isSetOrCollection(String type)
Returns true if current method's return type is a java.util.Collection or java.util.Set, false otherwise.
Parameters:
type - Description of Parameter
Returns:
true if Collection or Set

leftEJBName

public String leftEJBName()
            throws xdoclet.XDocletException
Returns the EJB Name of the left side of this relationship
Returns:
Left side's EJB name
Throws:
xdoclet.XDocletException -

leftFieldName

public String leftFieldName()
            throws xdoclet.XDocletException
Describe what the method does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -

leftFieldType

public String leftFieldType()
            throws xdoclet.XDocletException
Describe what the method does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -

leftMultiplicity

public String leftMultiplicity()
            throws xdoclet.XDocletException
Describe what the method does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -

leftRoleName

public String leftRoleName()
            throws xdoclet.XDocletException
Describe what the method does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -

relationComment

public String relationComment()
Describe what the method does
Returns:
Describe the return value

relationName

public String relationName()
            throws xdoclet.XDocletException
Returns:
the name of the current relation
Throws:
xdoclet.XDocletException -

rightEJBName

public String rightEJBName()
            throws xdoclet.XDocletException
Returns the EJB Name of the right side of this relationship
Returns:
Right side's EJB name
Throws:
xdoclet.XDocletException -

rightFieldName

public String rightFieldName()
            throws xdoclet.XDocletException
Describe what the method does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -

rightFieldType

public String rightFieldType()
            throws xdoclet.XDocletException
Describe what the method does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -

rightMultiplicity

public String rightMultiplicity()
            throws xdoclet.XDocletException
Describe what the method does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -

rightRoleName

public String rightRoleName()
            throws xdoclet.XDocletException
Describe what the method does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -