HomeTagsHandler (XDoclet 1.2.3 API)
Keywords: xdoclet.modules.ejb.home.HomeTagsHandler class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## xdoclet.modules.ejb.home
Class HomeTagsHandler

    java.lang.Object
      xdoclet.template.TemplateTagHandler
          xdoclet.XDocletTagSupport
              xdoclet.modules.ejb.EjbTagsHandler
                  xdoclet.modules.ejb.home.HomeTagsHandler

public class HomeTagsHandler
extends EjbTagsHandler

Version:
  $Revision: 1.37 $
Author:
  Ara Abrahamian (ara_e@email.com)
xdoclet.taghandler
  namespace="EjbHome"
created
  Oct 15, 2001

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
`HomeTagsHandler()`

Method Summary
`String` | `compName(Properties attributes)`
`String` | `currentExceptions()` Return exceptions for current home method.
`String` | `currentMethod()` Return name of current home method.
`String` | `currentPermission()` Return permission for current home method.
`String` | `currentSignature()` Return signature of current home method.
`String` | `currentType()` Return type of current home method.
`String` | `ejbPostCreateSignature(Properties attributes)` Returns the appropriate ejbPostCreate method name for the current ejbCreate method.
`String` | `extendsFrom(Properties attributes)` Returns the name of the class home interface extends.
`String` | `finderClass()` generates name for finder utility class backing current finder
`static String` | `finderSignatureFunger(String s, xjavadoc.XClass clazz, String type)` Describe what the method does
`static xjavadoc.XMethod` | `findFirstCreateMethodFor(xjavadoc.XClass clazz)` Describe what the method does
`void` | `forAllHomeMethods(String template, Properties attributes)` Iterates over all home methods of specified type (finder or create method) defined in a class and super classes.
`static String` | `fullPackageChange(String s)` Convert various collection types within a string to their fully qualified forms.
`static String` | `getCompNameFor(xjavadoc.XClass clazz, String type)` Returns a suitable component name (which could be used, for example, in JNDI lookups) for a class.
`protected String` | `getDependentClassFor(xjavadoc.XClass clazz, String type)` Gets the DependentClassFor attribute of the HomeTagsHandler object
`protected static String` | `getHomeClassPattern()` Gets the HomeClassPattern attribute of the HomeTagsHandler class.
`static String` | `getHomeDefinition(xjavadoc.XClass clazz, xjavadoc.XMethod method, String tagType, String type)` Gets the HomeDefinition attribute of the HomeTagsHandler class
`static String` | `getHomeInterface(String type, xjavadoc.XClass clazz)` Similar to `InterfaceTagsHandler.getComponentInterface(java.lang.String, xjavadoc.XClass)`.
`static String` | `getJndiNameOfTypeFor(String type, xjavadoc.XClass clazz)`
`protected static String` | `getLocalHomeClassPattern()` Gets the LocalHomeClassPattern attribute of the HomeTagsHandler class.
`String` | `homeInterface(Properties attributes)` Returns the full qualified local or remote home interface name for the bean, depending on the value of type parameter.
`void` | `ifDoesntHavePostCreateMethod(String template, Properties attributes)` Evaluates the body block if current create method's ejbPostCreate method does not exist.
`void` | `ifIsCollectionType(String template, Properties param)` Whether current finder return collection.
`void` | `ifIsCreateMethod(String template, Properties attributes)` Evaluates the body block if current method is a create method.
`void` | `ifIsEnumerationType(String template, Properties param)` Whether current finder return enumeration.
`void` | `ifIsFinderMethod(String template, Properties attributes)` Evaluates the body block if current method is a ejbFind method.
`void` | `ifIsHomeMethod(String template, Properties attributes)` Evaluates the body block if current method is a home method.
`void` | `ifIsInterfaceType(String template, Properties param)` Whether current finder return interface.
`void` | `ifNotRemoveMethod(String template)` Evaluates the body block if current method is not an ejbRemove method.
`static boolean` | `isCreateMethod(xjavadoc.XMethod method)` Returns true if method is a create method marked with a \@ejb.create-method tag, false otherwise.
`static boolean` | `isFinderMethod(xjavadoc.XMethod method)` Returns true if method is an ejbFind method, false otherwise.
`static boolean` | `isHomeMethod(xjavadoc.XMethod method)` Returns true if method is a home method marked with a \@ejb.home-method tag, false otherwise.
`static boolean` | `isRemoveMethod(xjavadoc.XMethod method)` Returns true if method is an ejbRemove method, false otherwise.
`String` | `jndiName(Properties attributes)`
`protected boolean` | `matchesViewType(Collection tags, String type)` Check every XTag in a collection and return true if they all have a view-type compatible with the specified type.
`protected boolean` | `matchesViewType(xjavadoc.XTag tag, String type)` Returns true if an XTag has a view-type compatible with the specified type.
`String` | `parameterList()` Return parameter list (names only) for current home method.
`String` | `parameterListDefinition()` Return parameter list definition (types and names) for current home method.
`protected void` | `setCurrentExceptions(String es)` Sets the CurrentExceptions attribute of the HomeTagsHandler object.
`void` | `setCurrentPermission(String permission)`
`protected void` | `setCurrentSignature(String cs)` Sets the CurrentSignature attribute of the HomeTagsHandler object.
`protected boolean` | `shouldTraverseSuperclassForDependentClass(xjavadoc.XClass clazz, String tag_name)` Describe what the method does
`static String` | `toCreateMethod(String methodName)` Converts ejbCreateblabla to createblabla , the one that should appear in home interface.
`static String` | `toFinderMethod(String methodName)` Converts ejbFindblabla to findblabla , the one that should appear in home interface.
`static String` | `toHomeMethod(String methodName)` Converts ejbHomeblabla to homeblabla , the one that should appear in home interface.

Methods inherited from class xdoclet.modules.ejb.EjbTagsHandler
`beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, ejbRefName, extendsFromFor, forAllBeans, 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, 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

### HomeTagsHandler

    public HomeTagsHandler()

Method Detail

### getHomeInterface

    public static String getHomeInterface(String type,
                                          xjavadoc.XClass clazz)
                                   throws XDocletException

  Similar to `InterfaceTagsHandler.getComponentInterface(java.lang.String, xjavadoc.XClass)`. Relies on the ejb:home tag, which has the following relevant properties:
  - remote-class: The fully qualified name of the remote class - overrides all set patterns
  - local-class: The fully qualified name of the local class - overrides all set patterns
  - remote-pattern: The pattern to be used to determine the unqualified name of the remote class
  - local-pattern: The pattern to be used to determine the unqualified name of the local class
  - pattern: The pattern to be used in determining the unqualified remote and/or local home interface name - used where remote- or local- pattern are not specified.
  - remote-package: The package the remote home interface is to be placed in
  - local-package: The package the local home interface is to be placed in
  - package: The package the remote and/or local home interface is to be placed in - used where remote- or local- package are not specified.

  Parameters:
    `type` - The type of home interface - can be remote or local.
    `clazz` - Description of Parameter
  Returns:
    The HomeInterface value
  Throws:
    `XDocletException`

### isRemoveMethod

    public static boolean isRemoveMethod(xjavadoc.XMethod method)

  Returns true if method is an ejbRemove method, false otherwise.

  Parameters:
    `method` - The method to test
  Returns:
    true if named ejbRemove

### isCreateMethod

    public static boolean isCreateMethod(xjavadoc.XMethod method)

  Returns true if method is a create method marked with a \@ejb.create-method tag, false otherwise.

  Parameters:
    `method` - The method to test
  Returns:
    true if ejb.create-method tag found

### isHomeMethod

    public static boolean isHomeMethod(xjavadoc.XMethod method)

  Returns true if method is a home method marked with a \@ejb.home-method tag, false otherwise.

  Parameters:
    `method` - The method to test
  Returns:
    true if ejb.home-method tag found

### getCompNameFor

    public static String getCompNameFor(xjavadoc.XClass clazz,
                                        String type)

  Returns a suitable component name (which could be used, for example, in JNDI lookups) for a class.

  Parameters:
    `clazz` - the class
    `type` - interface view type, \"local\" or \"remote\"
  Returns:
    compname

### isFinderMethod

    public static boolean isFinderMethod(xjavadoc.XMethod method)

  Returns true if method is an ejbFind method, false otherwise.

  Parameters:
    `method` - The method to test
  Returns:
    true if name starts with ejbFind

### getHomeDefinition

    public static String getHomeDefinition(xjavadoc.XClass clazz,
                                           xjavadoc.XMethod method,
                                           String tagType,
                                           String type)
                                    throws XDocletException

  Gets the HomeDefinition attribute of the HomeTagsHandler class

  Parameters:
    `clazz` - Describe what the parameter does
    `method` - Describe what the parameter does
    `tagType` - Describe what the parameter does
    `type` - Describe what the parameter does
  Returns:
    The HomeDefinition value
  Throws:
    `XDocletException`

### getJndiNameOfTypeFor

    public static String getJndiNameOfTypeFor(String type,
                                              xjavadoc.XClass clazz)

### toHomeMethod

    public static String toHomeMethod(String methodName)

  Converts ejbHomeblabla to homeblabla , the one that should appear in home interface.

  Parameters:
    `methodName` - Method name to be converted.
  Returns:
    Equivalent home interface method name.

### toCreateMethod

    public static String toCreateMethod(String methodName)

  Converts ejbCreateblabla to createblabla , the one that should appear in home interface.

  Parameters:
    `methodName` - Method name to be converted.
  Returns:
    Equivalent home interface method name.

### findFirstCreateMethodFor

    public static xjavadoc.XMethod findFirstCreateMethodFor(xjavadoc.XClass clazz)

  Describe what the method does

  Parameters:
    `clazz` - Describe what the parameter does
  Returns:
    Describe the return value

### toFinderMethod

    public static String toFinderMethod(String methodName)

  Converts ejbFindblabla to findblabla , the one that should appear in home interface.

  Parameters:
    `methodName` - Method name to be converted.
  Returns:
    Equivalent home interface method name.

### fullPackageChange

    public static String fullPackageChange(String s)

  Convert various collection types within a string to their fully qualified forms.

  Parameters:
    `s` - String to be converted.
  Returns:
    String with fully qualified collection types.

### finderSignatureFunger

    public static String finderSignatureFunger(String s,
                                               xjavadoc.XClass clazz,
                                               String type)
                                        throws XDocletException

  Describe what the method does

  Parameters:
    `s` - Describe what the parameter does
    `clazz` -
    `type` -
  Returns:
    Describe the return value
  Throws:
    `XDocletException`

### getLocalHomeClassPattern

    protected static String getLocalHomeClassPattern()

  Gets the LocalHomeClassPattern attribute of the HomeTagsHandler class.

  Returns:
    The LocalHomeClassPattern value

### getHomeClassPattern

    protected static String getHomeClassPattern()

  Gets the HomeClassPattern attribute of the HomeTagsHandler class.

  Returns:
    The HomeClassPattern value

### setCurrentPermission

    public void setCurrentPermission(String permission)

### homeInterface

    public String homeInterface(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`
  doc.tag
    type="content"
  doc.param
    name="type" optional="false" values="remote,local" description="Specifies the type of component home interface."

### ifIsCreateMethod

    public void ifIsCreateMethod(String template,
                                 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`
  See Also:
    `isCreateMethod(xjavadoc.XMethod)`
  doc.tag
    type="block"
  doc.param
    name="superclasses" optional="true" description="Traverse superclasses too. With false value used in remote/local home interface templates. Default is False."

### ifDoesntHavePostCreateMethod

    public void ifDoesntHavePostCreateMethod(String template,
                                             Properties attributes)
                                      throws XDocletException

  Evaluates the body block if current create method's ejbPostCreate method does not exist.

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

### ejbPostCreateSignature

    public String ejbPostCreateSignature(Properties attributes)

  Returns the appropriate ejbPostCreate method name for the current ejbCreate method.

  Parameters:
    `attributes` - The attributes of the template tag
  Returns:
    Equivalent ejbPostCreate method name
  doc.tag
    type="content"

### ifIsHomeMethod

    public void ifIsHomeMethod(String template,
                               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`
  See Also:
    `isHomeMethod(xjavadoc.XMethod)`
  doc.tag
    type="block"
  doc.param
    name="superclasses" optional="true" description="Traverse superclasses too. With false value used in remote/local home interface templates. Default is False."

### ifNotRemoveMethod

    public void ifNotRemoveMethod(String template)
                           throws XDocletException

  Evaluates the body block if current method is not an ejbRemove method.

  Parameters:
    `template` - The body of the block tag
  Throws:
    `XDocletException`
  See Also:
    `isRemoveMethod(xjavadoc.XMethod)`
  doc.tag
    type="block"

### ifIsFinderMethod

    public void ifIsFinderMethod(String template,
                                 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:
    `isFinderMethod(xjavadoc.XMethod)`
  doc.tag
    type="block"
  doc.param
    name="superclasses" optional="true" description="Traverse superclasses too. With false value used in remote/local home interface templates. Default is False."

### compName

    public String compName(Properties attributes)
                    throws XDocletException

  Parameters:
    `attributes` - The attributes of the template tag
  Returns:
    Description of the Returned Value
  Throws:
    `XDocletException`
  doc.tag
    type="content"
  doc.param
    name="prefixWithEjbSlash" optional="true" values="true,false" description="Specifies whether to prefix it with ejb/ or not. False by default.", name="type" optional="false" values="remote,local" description="Specifies if we want the jndi name value for local or remote lookup."

### jndiName

    public String jndiName(Properties attributes)
                    throws XDocletException

  Parameters:
    `attributes` -
  Returns:
    Description of the Returned Value
  Throws:
    `XDocletException`
  doc.tag
    type="content"
  doc.param
    name="type" optional="false" values="remote,local" description="Specifies if we want the jndi name value for local or remote lookup."

### extendsFrom

    public String extendsFrom(Properties attributes)
                       throws XDocletException

  Returns the name of the class home interface extends.

  Parameters:
    `attributes` -
  Returns:
    The name of generated PK class.
  Throws:
    `XDocletException`
  doc.tag
    type="content"

### forAllHomeMethods

    public void forAllHomeMethods(String template,
                                  Properties attributes)
                           throws XDocletException

  Iterates over all home methods of specified type (finder or create method) defined in a class and super classes.

  Parameters:
    `template` - The body of the block tag
    `attributes` - The attributes of the template tag
  Throws:
    `XDocletException`
  doc.tag
    type="block"
  doc.param
    name="tagName" optional="false" description="The tag name for the method type to iterate over." values="ejb:finder,ejb:create-method", name="superclasses" values="true,false" description="If true then traverse superclasses also, otherwise look up the tag in current concrete class only.", name="tagKey" description="A tag property that will be used as a unique key. This is used to avoid duplicate code due to similar tags in superclasses."

### currentSignature

    public String currentSignature()
                            throws XDocletException

  Return signature of current home method.

  Returns:
    Describe the return value
  Throws:
    `XDocletException`

### currentPermission

    public String currentPermission()
                             throws XDocletException

  Return permission for current home method.

  Returns:
  Throws:
    `XDocletException`
  doc.tag
    type="content"

### currentType

    public String currentType()
                       throws XDocletException

  Return type of current home method.

  Returns:
  Throws:
    `XDocletException`
  doc.tag
    type="content"
  To do:
    i18n

### finderClass

    public String finderClass()
                       throws XDocletException

  generates name for finder utility class backing current finder

  Returns:
  Throws:
    `XDocletException`
  doc.tag
    type="content"
  To do:
    i18n

### ifIsCollectionType

    public void ifIsCollectionType(String template,
                                   Properties param)
                            throws XDocletException

  Whether current finder return collection.

  Parameters:
    `template` -
    `param` -
  Throws:
    `XDocletException`
  doc.tag
    type="block"

### ifIsEnumerationType

    public void ifIsEnumerationType(String template,
                                    Properties param)
                             throws XDocletException

  Whether current finder return enumeration.

  Parameters:
    `template` -
    `param` -
  Throws:
    `XDocletException`
  doc.tag
    type="block"

### ifIsInterfaceType

    public void ifIsInterfaceType(String template,
                                  Properties param)
                           throws XDocletException

  Whether current finder return interface.

  Parameters:
    `template` -
    `param` -
  Throws:
    `XDocletException`
  doc.tag
    type="block"

### currentMethod

    public String currentMethod()
                         throws XDocletException

  Return name of current home method.

  Returns:
    method name
  Throws:
    `XDocletException`
  doc.tag
    type="content"
  To do:
    i18n

### parameterListDefinition

    public String parameterListDefinition()
                                   throws XDocletException

  Return parameter list definition (types and names) for current home method.

  Returns:
    comma-separated parameter list
  Throws:
    `XDocletException`
  doc.tag
    type="content"
  To do:
    i18n

### parameterList

    public String parameterList()
                         throws XDocletException

  Return parameter list (names only) for current home method.

  Returns:
    comma-separated parameter list
  Throws:
    `XDocletException`
  doc.tag
    type="content"

### currentExceptions

    public String currentExceptions()
                             throws XDocletException

  Return exceptions for current home method.

  Returns:
    exceptions
  Throws:
    `XDocletException`
  doc.tag
    type="content"

### getDependentClassFor

    protected String getDependentClassFor(xjavadoc.XClass clazz,
                                          String type)
                                   throws XDocletException

  Gets the DependentClassFor attribute of the HomeTagsHandler object

  Overrides:
    `getDependentClassFor` in class `EjbTagsHandler`
  Parameters:
    `clazz` - Describe what the parameter does
    `type` - Describe what the parameter does
  Returns:
    The DependentClassFor value
  Throws:
    `XDocletException`

### setCurrentSignature

    protected void setCurrentSignature(String cs)

  Sets the CurrentSignature attribute of the HomeTagsHandler object.

  Parameters:
    `cs` - The new CurrentSignature value

### setCurrentExceptions

    protected void setCurrentExceptions(String es)

  Sets the CurrentExceptions attribute of the HomeTagsHandler object.

  Parameters:
    `es` - The new CurrentExceptions value

### shouldTraverseSuperclassForDependentClass

    protected boolean shouldTraverseSuperclassForDependentClass(xjavadoc.XClass clazz,
                                                                String tag_name)
                                                         throws XDocletException

  Describe what the method does

  Overrides:
    `shouldTraverseSuperclassForDependentClass` in class `EjbTagsHandler`
  Parameters:
    `clazz` - Describe what the parameter does
    `tag_name` - Describe what the parameter does
  Returns:
    Describe the return value
  Throws:
    `XDocletException`

### matchesViewType

    protected boolean matchesViewType(xjavadoc.XTag tag,
                                      String type)

  Returns true if an XTag has a view-type compatible with the specified type. A view-type is compatible if it is the same as type or \"both\". A missing or empty view-type is assumed to be compatible.

  Parameters:
    `tag` - The XTag to check
    `type` - The desired view-type
  Returns:
    true if the tag's view-type is compatible

### matchesViewType

    protected boolean matchesViewType(Collection tags,
                                      String type)

  Check every XTag in a collection and return true if they all have a view-type compatible with the specified type. A view-type is compatible if it is the same as type or \"both\". A missing or empty view-type is assumed to be compatible.

  Parameters:
    `tags` - Collection of XTag to be checked.
    `type` - The desired view-type
  Returns:
    true if all tags' view-type parameters are compatible

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://xdoclet.sourceforge.net/
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD