xdoclet.ejb.tags
Class InterfaceTagsHandler

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

public class InterfaceTagsHandler
extends EjbTagsHandler

Version:
$Revision: 1.21 $
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
InterfaceTagsHandler()
           
 
Method Summary
 java.lang.String beanClassNameFromInterfaceName(java.util.Properties attributes)
          Returns the bean implementation class name for the interface name specified as the return type of current method or the method specified by parameter interface if any.
 java.lang.String componentInterface(java.util.Properties attributes)
          Returns the full qualified local or remote interface name for the bean, depending on the value of type parameter.
 java.lang.String extendsFrom(java.util.Properties attributes)
          Returns the name of the class home interface extends.
 void forAllInterfaceViewTypes(java.lang.String template, java.util.Properties attributes)
          Evaluates the body block for each view-type of current method.
protected  java.lang.String fromInterfaceToBean(java.lang.String value)
          Loops over all classes and if value equals to local or remote interface name of an EJBean full qualified name of that EJB is returned.
static java.lang.String getBeanClassNameFromInterfaceNameFor(java.lang.String return_type)
           
static java.lang.String getComponentInterface(java.lang.String type, com.sun.javadoc.ClassDoc clazz)
          Return the fully qualified name of the component interface of type specified.
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  java.lang.String getInterfaceMethodName(java.lang.String name)
          Returns the interface method name depending on its type.
protected static java.lang.String getLocalClassPattern()
           
protected static java.lang.String getRemoteClassPattern()
           
 void ifIsInterfaceMethod(java.lang.String template)
          Evaluates the body block if ejb:interface-method defined for current method.
 void ifIsInterfaceMethod(java.lang.String template, java.util.Properties attributes)
          Evaluate the body block if the current method is an EJB local or remote interface method.
 void ifIsNotInterfaceMethod(java.lang.String template, java.util.Properties attributes)
          Evaluate the body block if the current method is not an EJB local or remote interface method.
 java.lang.String interfaceMethodName()
          Returns interface method name for the current interface method.
static boolean isComponentInterfaceMethod(com.sun.javadoc.MethodDoc method)
          Returns true if method is a component interface method, false otherwise.
static boolean isInterfaceMethod(com.sun.javadoc.MethodDoc method)
          Returns true if method is an interface method, false otherwise.
protected  boolean isInterfaceMethod(java.lang.String intFace)
          Implements functionality required by ifIsInterfaceMethod(java.lang.String, java.util.Properties) and ifIsNotInterfaceMethod(java.lang.String, java.util.Properties).
static boolean isLocalMethod(com.sun.javadoc.MethodDoc method)
          Returns true if method is a local interface method by looking at view-type parameter.
static boolean isRemoteMethod(com.sun.javadoc.MethodDoc method)
          Returns true if method is a remote interface method by looking at view-type parameter.
 java.lang.String methodIntf(java.util.Properties attributes)
          Returns "Remote" is current method has ejb:remote-method defined, "Home" otherwise.
 
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, shouldTraverseSuperclassForDependentClass, 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

InterfaceTagsHandler

public InterfaceTagsHandler()
Method Detail

getComponentInterface

public static java.lang.String getComponentInterface(java.lang.String type,
                                                     com.sun.javadoc.ClassDoc clazz)
                                              throws XDocletException
Return the fully qualified name of the component interface of type specified. Works based on the ejb:interface class level tag. Relevant parameters for the ejb:interface tag are:
Parameters:
type - Can be remote or local. Defaults to remote.
clazz - Description of Parameter
Returns:
The fully qualified name of the interface.
Throws:
XDocletException - Description of Exception

isInterfaceMethod

public static boolean isInterfaceMethod(com.sun.javadoc.MethodDoc method)
                                 throws XDocletException
Returns true if method is an interface method, false otherwise. Interface methods are remote/create/remove/finder/home methods.
Parameters:
method - Description of Parameter
Returns:
The InterfaceMethod value
Throws:
XDocletException - Description of Exception

isComponentInterfaceMethod

public static boolean isComponentInterfaceMethod(com.sun.javadoc.MethodDoc method)
                                          throws XDocletException
Returns true if method is a component interface method, false otherwise. Component interface methods are marked with a ejb:interface-method tag.
Parameters:
method - Description of Parameter
Returns:
The RemoteMethod value
Throws:
XDocletException - Description of Exception

getBeanClassNameFromInterfaceNameFor

public static java.lang.String getBeanClassNameFromInterfaceNameFor(java.lang.String return_type)
                                                             throws XDocletException

isRemoteMethod

public static boolean isRemoteMethod(com.sun.javadoc.MethodDoc method)
                              throws XDocletException
Returns true if method is a remote interface method by looking at view-type parameter.
Parameters:
method - Description of Parameter
Returns:
The isRemoteMethod value
Throws:
XDocletException - Description of Exception

isLocalMethod

public static boolean isLocalMethod(com.sun.javadoc.MethodDoc method)
                             throws XDocletException
Returns true if method is a local interface method by looking at view-type parameter.
Parameters:
method - Description of Parameter
Returns:
The isRemoteMethod value
Throws:
XDocletException - Description of Exception

getRemoteClassPattern

protected static java.lang.String getRemoteClassPattern()

getLocalClassPattern

protected static java.lang.String getLocalClassPattern()

componentInterface

public java.lang.String componentInterface(java.util.Properties attributes)
                                    throws XDocletException
Returns the full qualified local or remote 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

ifIsNotInterfaceMethod

public void ifIsNotInterfaceMethod(java.lang.String template,
                                   java.util.Properties attributes)
                            throws XDocletException
Evaluate the body block if the current method is not an EJB local or remote interface method.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception

ifIsInterfaceMethod

public void ifIsInterfaceMethod(java.lang.String template,
                                java.util.Properties attributes)
                         throws XDocletException
Evaluate the body block if the current method is an EJB local or remote interface method.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception

forAllInterfaceViewTypes

public void forAllInterfaceViewTypes(java.lang.String template,
                                     java.util.Properties attributes)
                              throws XDocletException
Evaluates the body block for each view-type of current method. Sets currentMethodViewType internal variable of tag handler class, used by nested methodIntf.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception

ifIsInterfaceMethod

public void ifIsInterfaceMethod(java.lang.String template)
                         throws XDocletException
Evaluates the body block if ejb:interface-method defined for current method.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
isInterfaceMethod(com.sun.javadoc.MethodDoc)

methodIntf

public java.lang.String methodIntf(java.util.Properties attributes)
                            throws XDocletException
Returns "Remote" is current method has ejb:remote-method defined, "Home" otherwise.
Parameters:
attributes - The attributes of the template tag
Returns:
"Remote" or "Home".
Throws:
XDocletException - Description of Exception
See Also:
isRemoteMethod(com.sun.javadoc.MethodDoc)

interfaceMethodName

public java.lang.String interfaceMethodName()
                                     throws XDocletException
Returns interface method name for the current interface method.
Returns:
"Remote" or "Home".
Throws:
XDocletException - Description of Exception
See Also:
getInterfaceMethodName(java.lang.String)

beanClassNameFromInterfaceName

public java.lang.String beanClassNameFromInterfaceName(java.util.Properties attributes)
                                                throws XDocletException
Returns the bean implementation class name for the interface name specified as the return type of current method or the method specified by parameter interface if any.
Parameters:
attributes -  
Returns:
Bean class name
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

isInterfaceMethod

protected boolean isInterfaceMethod(java.lang.String intFace)
                             throws XDocletException
Implements functionality required by ifIsInterfaceMethod(java.lang.String, java.util.Properties) and ifIsNotInterfaceMethod(java.lang.String, java.util.Properties). To determine what interfaces the method should appear in, check the first for a view-type parameter to the method level ejb:interface-method tag. If that is absent use the view-type tag from ejb:bean .
Parameters:
intFace - The type of interface to test the method for.
Returns:
true if the method should occur in the specified interface.
Throws:
XDocletException - Description of Exception

getInterfaceMethodName

protected java.lang.String getInterfaceMethodName(java.lang.String name)
                                           throws XDocletException
Returns the interface method name depending on its type.
Parameters:
name - Description of Parameter
Returns:
"create" if ejbCreate, "remote" if ejbRemove, find if ejbFind, home if ejbHome.
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 -  

fromInterfaceToBean

protected java.lang.String fromInterfaceToBean(java.lang.String value)
                                        throws XDocletException
Loops over all classes and if value equals to local or remote interface name of an EJBean full qualified name of that EJB is returned.
Parameters:
value - Description of Parameter
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception