User: dimc    
  Date: 02/04/08 06:38:30

  Modified:    core/src/xdoclet/ejb/tags HomeTagsHandler.java
  Log:
  1. Fixed bug where @jboss:table-name wasn't picked up unless the attribute
  was named.
  
  2. Added functionality in entity-body.j where ejbCreate() methods without
  coresponding ejbPostCreate methods have their ejbPostCreate() methods
  generated (empty).
  
  Revision  Changes    Path
  1.30      +49 -1     xdoclet/core/src/xdoclet/ejb/tags/HomeTagsHandler.java
  
  Index: HomeTagsHandler.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/HomeTagsHandler.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -w -r1.29 -r1.30
  --- HomeTagsHandler.java      6 Apr 2002 04:02:41 -0000       1.29
  +++ HomeTagsHandler.java      8 Apr 2002 13:38:29 -0000       1.30
  @@ -27,7 +27,7 @@
   /**
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @created   Oct 15, 2001
  - * @version   $Revision: 1.29 $
  + * @version   $Revision: 1.30 $
    */
   public class HomeTagsHandler extends EjbTagsHandler
   {
  @@ -484,6 +484,54 @@
   
                        generate( template );
                }
  +     }
  +
  +     /**
  +      * Evaluates the body block if current create method's ejbPostCreate method
  +      * does not exist.
  +      *
  +      * @param template              The body of the block tag
  +      * @param attributes            The attributes of the template tag
  +      * @exception XDocletException  Description of Exception
  +      * @doc:tag                     type="block"
  +      */
  +     public void ifDoesntHavePostCreateMethod( String template, Properties 
attributes )
  +              throws XDocletException
  +     {
  +             XMethod currentMethod = getCurrentMethod();
  +
  +             if( !isCreateMethod( currentMethod ) )
  +             {
  +                     throw new XDocletException( "Cannot call 
ifDoesntHavePostCreateMethod if the current method is not a create method: "
  +                              + currentMethod );
  +             }
  +
  +             StringBuffer currentMethodName = new StringBuffer( 
currentMethod.nameWithSignature() );
  +
  +             currentMethodName.insert( 3, "Post" );
  +
  +             XMethod ejbPostCreateMethod = getCurrentClass().getMethod( 
currentMethodName.toString() );
  +
  +             if( ejbPostCreateMethod == null )
  +             {
  +                     generate( template );
  +             }
  +     }
  +
  +     /**
  +      * Returns the appropriate ejbPostCreate method name for the current ejbCreate
  +      * method.
  +      *
  +      * @param attributes  The attributes of the template tag
  +      * @return            Description of the Returned Value
  +      * @doc:tag           type="content"
  +      */
  +     public String ejbPostCreateSignature( Properties attributes )
  +     {
  +             StringBuffer currentMethodName = new StringBuffer( 
getCurrentMethod().name() );
  +
  +             currentMethodName.insert( 3, "Post" );
  +             return currentMethodName.toString();
        }
   
        /**
  
  
  

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to