xdoclet.ejb.tags
Class HomeTagsHandler

java.lang.Object
  |
  +--xdoclet.template.TemplateTagHandler
        |
        +--xdoclet.XDocletTagSupport
              |
              +--xdoclet.ejb.tags.EjbTagsHandler
                    |
                    +--xdoclet.ejb.tags.HomeTagsHandler

public class HomeTagsHandler
extends EjbTagsHandler

Version:
$Revision: 1.19 $
Author:
Ara Abrahamian (ara_e@email.com)

Fields inherited from class xdoclet.ejb.tags.EjbTagsHandler
LOCAL_SUFFIX
 
Fields inherited from class xdoclet.XDocletTagSupport
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
 
Constructor Summary
HomeTagsHandler()
           
 
Method Summary
 java.lang.String compName(java.util.Properties attributes)
           
 java.lang.String extendsFrom(java.util.Properties attributes)
          Returns the name of the class home interface extends.
static com.sun.javadoc.MethodDoc findFirstCreateMethodFor(com.sun.javadoc.ClassDoc clazz)
           
static java.lang.String getCompNameFor(com.sun.javadoc.ClassDoc clazz, java.lang.String type)
           
protected  java.lang.String getDependentClassFor(com.sun.javadoc.ClassDoc clazz, java.lang.String type)
          sub-classes which deal with patternized class names return a reasonable value
protected static java.lang.String getHomeClassPattern()
           
static java.lang.String getHomeInterface(java.lang.String type, com.sun.javadoc.ClassDoc clazz)
          Similar to InterfaceTagsHandler.getComponentInterface(java.lang.String, com.sun.javadoc.ClassDoc).
protected static java.lang.String getLocalHomeClassPattern()
           
 java.lang.String homeInterface(java.util.Properties attributes)
          Returns the full qualified local or remote home interface name for the bean, depending on the value of type parameter.
 void ifIsCreateMethod(java.lang.String template, java.util.Properties attributes)
          Evaluates the body block if current method is a create method.
 void ifIsFinderMethod(java.lang.String template, java.util.Properties attributes)
          Evaluates the body block if current method is a ejbFind method.
 void ifIsHomeMethod(java.lang.String template, java.util.Properties attributes)
          Evaluates the body block if current method is a home method.
 void ifNotRemoveMethod(java.lang.String template)
          Evaluates the body block if current method is ejbRemove method.
static boolean isCreateMethod(com.sun.javadoc.MethodDoc method)
          Returns true if method is a create method marked with a ejb:create-method tag, false otherwise.
static boolean isFinderMethod(com.sun.javadoc.MethodDoc method)
          Returns true if method is an ejbFind method, false otherwise.
static boolean isHomeMethod(com.sun.javadoc.MethodDoc method)
          Returns true if method is a home method marked with a ejb:home-method tag, false otherwise.
static boolean isRemoveMethod(com.sun.javadoc.MethodDoc method)
          Returns true if method is an ejbRemove method, false otherwise.
 java.lang.String jndiName(java.util.Properties attributes)
           
protected  boolean shouldTraverseSuperclassForDependentClass(com.sun.javadoc.ClassDoc clazz, java.lang.String tag_name)
           
static java.lang.String toCreateMethod(java.lang.String methodName)
          Converts ejbCreateblabla to createblabla , the one that should appear in home interface.
static java.lang.String toFinderMethod(java.lang.String methodName)
          Converts ejbFindblabla to findblabla , the one that should appear in home interface.
static java.lang.String toHomeMethod(java.lang.String methodName)
          Converts ejbHomeblabla to homeblabla , the one that should appear in home interface.
 
Methods inherited from class xdoclet.ejb.tags.EjbTagsHandler
beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, extendsFromFor, forAllBeans, getDependentClassTagName, getEjbIdFor, getEjbNameFor, getEjbSpec, getShortEjbNameFor, hasPermission, hasTransaction, id, ifIsAConcreteEJBean, ifLocalEjb, ifNotLocalEjb, ifNotRemoteEjb, ifRemoteEjb, isAConcreteEJBean, isEjb, isLocalEjb, isOnlyLocalEjb, isOnlyRemoteEjb, isRemoteEjb, prefixWithEjbSlash, shortEjbName, symbolicClassName
 
Methods inherited from class xdoclet.XDocletTagSupport
getClassTagValue, getClassTagValue, getConstructorTagValue, getCurrentClass, getCurrentConstructor, getCurrentField, getCurrentMethod, getCurrentPackage, getCurrentTag, getDocletContext, getFieldTagValue, getFieldTagValue, getMethodTagValue, getMethodTagValue, getParameterValue, getParameterValue, getTagValue, getTagValue, getTagValue, invalidParamValueFound, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, parsePropertyString, popCurrentClass, pushCurrentClass, replaceProperties, setCurrentClass, setCurrentConstructor, setCurrentField, setCurrentMethod, setCurrentPackage, setCurrentTag, tokenizeValue
 
Methods inherited from class xdoclet.template.TemplateTagHandler
generate, getContext, getEngine, getParser, setContext, setEngine, setParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HomeTagsHandler

public HomeTagsHandler()
Method Detail

getHomeInterface

public static java.lang.String getHomeInterface(java.lang.String type,
                                                com.sun.javadoc.ClassDoc clazz)
                                         throws XDocletException
Similar to InterfaceTagsHandler.getComponentInterface(java.lang.String, com.sun.javadoc.ClassDoc). Relies on the ejb:home tag, which has the following relevant properties:
Parameters:
type - The type of home interface - can be remote or local.
clazz - Description of Parameter
Returns:
The HomeInterface value
Throws:
XDocletException - Description of Exception

isFinderMethod

public static boolean isFinderMethod(com.sun.javadoc.MethodDoc method)
                              throws XDocletException
Returns true if method is an ejbFind method, false otherwise.
Parameters:
method - Description of Parameter
Returns:
The FinderMethod value
Throws:
XDocletException - Description of Exception

isRemoveMethod

public static boolean isRemoveMethod(com.sun.javadoc.MethodDoc method)
                              throws XDocletException
Returns true if method is an ejbRemove method, false otherwise.
Parameters:
method - Description of Parameter
Returns:
The RemoveMethod value
Throws:
XDocletException - Description of Exception

isCreateMethod

public static boolean isCreateMethod(com.sun.javadoc.MethodDoc method)
                              throws XDocletException
Returns true if method is a create method marked with a ejb:create-method tag, false otherwise.
Parameters:
method - Description of Parameter
Returns:
The CreateMethod value
Throws:
XDocletException - Description of Exception

isHomeMethod

public static boolean isHomeMethod(com.sun.javadoc.MethodDoc method)
                            throws XDocletException
Returns true if method is a home method marked with a ejb:home-method tag, false otherwise.
Parameters:
method - Description of Parameter
Returns:
The HomeMethod value
Throws:
XDocletException - Description of Exception

getCompNameFor

public static java.lang.String getCompNameFor(com.sun.javadoc.ClassDoc clazz,
                                              java.lang.String type)
                                       throws XDocletException

toHomeMethod

public static java.lang.String toHomeMethod(java.lang.String methodName)
                                     throws XDocletException
Converts ejbHomeblabla to homeblabla , the one that should appear in home interface.
Parameters:
methodName - Description of Parameter
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

toCreateMethod

public static java.lang.String toCreateMethod(java.lang.String methodName)
                                       throws XDocletException
Converts ejbCreateblabla to createblabla , the one that should appear in home interface.
Parameters:
methodName - Description of Parameter
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

toFinderMethod

public static java.lang.String toFinderMethod(java.lang.String methodName)
                                       throws XDocletException
Converts ejbFindblabla to findblabla , the one that should appear in home interface.
Parameters:
methodName - Description of Parameter
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

findFirstCreateMethodFor

public static com.sun.javadoc.MethodDoc findFirstCreateMethodFor(com.sun.javadoc.ClassDoc clazz)
                                                          throws XDocletException

getLocalHomeClassPattern

protected static java.lang.String getLocalHomeClassPattern()

getHomeClassPattern

protected static java.lang.String getHomeClassPattern()

homeInterface

public java.lang.String homeInterface(java.util.Properties attributes)
                               throws XDocletException
Returns the full qualified local or remote home interface name for the bean, depending on the value of type parameter.
Parameters:
attributes - The attributes of the template tag
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

ifIsCreateMethod

public void ifIsCreateMethod(java.lang.String template,
                             java.util.Properties attributes)
                      throws XDocletException
Evaluates the body block if current method is a create method. Create methods should have ejb:create-method defined.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception
See Also:
isCreateMethod(com.sun.javadoc.MethodDoc)

ifIsHomeMethod

public void ifIsHomeMethod(java.lang.String template,
                           java.util.Properties attributes)
                    throws XDocletException
Evaluates the body block if current method is a home method. Home methods should have ejb:home-method defined.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception
See Also:
isHomeMethod(com.sun.javadoc.MethodDoc)

ifNotRemoveMethod

public void ifNotRemoveMethod(java.lang.String template)
                       throws XDocletException
Evaluates the body block if current method is ejbRemove method.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
isRemoveMethod(com.sun.javadoc.MethodDoc)

ifIsFinderMethod

public void ifIsFinderMethod(java.lang.String template,
                             java.util.Properties attributes)
                      throws XDocletException
Evaluates the body block if current method is a ejbFind method.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception
See Also:
isHomeMethod(com.sun.javadoc.MethodDoc)

compName

public java.lang.String compName(java.util.Properties attributes)
                          throws XDocletException
Parameters:
attributes - The attributes of the template tag
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

jndiName

public java.lang.String jndiName(java.util.Properties attributes)
                          throws XDocletException
Parameters:
attributes -  
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

extendsFrom

public java.lang.String extendsFrom(java.util.Properties attributes)
                             throws XDocletException
Returns the name of the class home interface extends.
Parameters:
attributes -  
Returns:
The name of generated PK class.
Throws:
XDocletException - Description of Exception

getDependentClassFor

protected java.lang.String getDependentClassFor(com.sun.javadoc.ClassDoc clazz,
                                                java.lang.String type)
                                         throws XDocletException
Description copied from class: EjbTagsHandler
sub-classes which deal with patternized class names return a reasonable value
Overrides:
getDependentClassFor in class EjbTagsHandler
Following copied from class: xdoclet.ejb.tags.EjbTagsHandler
Parameters:
clazz - the class
type - type value used for view-type of remote/local
Returns:
dependent class name for the class and type
Throws:
XDocletException -  

shouldTraverseSuperclassForDependentClass

protected boolean shouldTraverseSuperclassForDependentClass(com.sun.javadoc.ClassDoc clazz,
                                                            java.lang.String tag_name)
                                                     throws XDocletException
Overrides:
shouldTraverseSuperclassForDependentClass in class EjbTagsHandler