User: pathoss 
  Date: 02/05/12 06:53:29

  Modified:    modules/ejb/src/xdoclet/modules/ejb/home Tag:
                        MODULE_REFACTORING_BRANCH HomeInterfaceSubTask.java
                        HomeTagsHandler.java LocalHomeInterfaceSubTask.java
  Log:
  Refactored. Fixed compilation errors and warnings.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +180 -180  
xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/HomeInterfaceSubTask.java
  
  Index: HomeInterfaceSubTask.java
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/HomeInterfaceSubTask.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -w -r1.1.2.5 -r1.1.2.6
  --- HomeInterfaceSubTask.java 2 May 2002 20:20:30 -0000       1.1.2.5
  +++ HomeInterfaceSubTask.java 12 May 2002 13:53:29 -0000      1.1.2.6
  @@ -4,64 +4,57 @@
    */
   package xdoclet.modules.ejb.home;
   
  +import java.io.File;
  +
  +import org.apache.commons.logging.Log;
  +
   import xjavadoc.XClass;
   import xjavadoc.XTag;
   
  -import org.apache.log4j.Category;
  -
   import xdoclet.TemplateSubTask;
   import xdoclet.XDocletException;
   import xdoclet.XDocletTagSupport;
  -import xdoclet.tagshandler.PackageTagsHandler;
  -
  -import xdoclet.util.Log;
  -import xdoclet.util.Translator;
  -
  -import java.io.File;
   
   import xdoclet.modules.ejb.AbstractEjbCodeGeneratorSubTask;
  -import xdoclet.modules.ejb.intf.InterfaceTagsHandler;
   import xdoclet.modules.ejb.home.HomeTagsHandler;
  +import xdoclet.modules.ejb.intf.InterfaceTagsHandler;
  +import xdoclet.tagshandler.PackageTagsHandler;
  +
  +import xdoclet.util.LogUtil;
  +import xdoclet.util.Translator;
   
   /**
  - * @xdoclet:subtask name="homeinterface" parent="xdoclet.modules.ejb.EjbDocletTask"
  - *
    * @author Ara Abrahamian ([EMAIL PROTECTED])
    * @created Oct 15, 2001
  - * @version $Revision: 1.1.2.5 $
  + * @xdoclet:subtask   name="homeinterface"
  + *      parent="xdoclet.modules.ejb.EjbDocletTask"
  + * @version           $Revision: 1.1.2.6 $
    */
  -public class HomeInterfaceSubTask extends AbstractEjbCodeGeneratorSubTask {
  +public class HomeInterfaceSubTask extends AbstractEjbCodeGeneratorSubTask
  +{
  +    public final static String SUBTASK_NAME = "homeInterface";
  +
  +    public final static String DEFAULT_HOMEINTERFACE_CLASS_PATTERN = "{0}Home";
  +
  +    protected static String DEFAULT_TEMPLATE_FILE = "resources/home.xdt";
   
        /**
  -      * A configuration parameter for specifying the home interface name pattern. By
  -      * default the value is used for deciding the home interface name. {0} in the
  -      * value mean current class's symbolic name which for an EJBean is the EJB
  -      * name.
  +     * A configuration parameter for specifying the home interface name pattern.
  +     * By default the value is used for deciding the home interface name. {0} in
  +     * the value mean current class's symbolic name which for an EJBean is the
  +     * EJB name.
         *
         * @see #getHomeClassPattern()
         */
        protected String homeClassPattern;
  -     /**
  -      * @todo-javadoc Describe the field
  -      */
  -     public final static String SUBTASK_NAME = "homeInterface";
  -
  -     /**
  -      * @todo-javadoc Describe the field
  -      */
  -     public final static String DEFAULT_HOMEINTERFACE_CLASS_PATTERN = "{0}Home";
  -     /**
  -      * @todo-javadoc Describe the field
  -      */
  -     protected static String DEFAULT_TEMPLATE_FILE = "resources/home.xdt";
  -
   
        /**
         * Describe what the HomeInterfaceSubTask constructor does
         *
         * @todo-javadoc Write javadocs for constructor
         */
  -     public HomeInterfaceSubTask() {
  +    public HomeInterfaceSubTask()
  +    {
                setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
                setDestinationFile(getHomeClassPattern() + ".java");
                setOfType("javax.ejb.EntityBean,javax.ejb.SessionBean");
  @@ -69,40 +62,28 @@
   
   
        /**
  -      * Sets the Pattern attribute of the HomeInterfaceSubTask object
  -      *
  -      * @param new_pattern The new Pattern value
  -      */
  -     public void setPattern(String new_pattern) {
  -             Category cat = Log.getCategory(HomeInterfaceSubTask.class, 
"setPattern");
  -
  -             cat.debug("Set pattern to " + new_pattern);
  -
  -             homeClassPattern = new_pattern;
  -     }
  -
  -
  -     /**
         * Gets the SubTaskName attribute of the HomeInterfaceSubTask object
         *
         * @return The SubTaskName value
         */
  -     public String getSubTaskName() {
  +    public String getSubTaskName()
  +    {
                return SUBTASK_NAME;
        }
   
   
        /**
  -      * Returns the configuration parameter for specifying the home interface name
  -      * pattern. By default the value is used for deciding the home interface name.
  -      * {0} in the value mean current class's symbolic name which for an EJBean is
  -      * the EJB name. If nothing explicitly specified by user then "{0}Home" is used
  -      * by default.
  +     * Returns the configuration parameter for specifying the home interface
  +     * name pattern. By default the value is used for deciding the home
  +     * interface name. {0} in the value mean current class's symbolic name which
  +     * for an EJBean is the EJB name. If nothing explicitly specified by user
  +     * then "{0}Home" is used by default.
         *
         * @return The HomeClassPattern value
         * @see #homeClassPattern
         */
  -     public String getHomeClassPattern() {
  +    public String getHomeClassPattern()
  +    {
                if (homeClassPattern != null) {
                        return homeClassPattern;
                }
  @@ -113,11 +94,27 @@
   
   
        /**
  +     * Sets the Pattern attribute of the HomeInterfaceSubTask object
  +     *
  +     * @param new_pattern  The new Pattern value
  +     */
  +    public void setPattern(String new_pattern)
  +    {
  +        Log log = LogUtil.getLog(HomeInterfaceSubTask.class, "setPattern");
  +
  +        log.debug("Set pattern to " + new_pattern);
  +
  +        homeClassPattern = new_pattern;
  +    }
  +
  +
  +    /**
         * Called to validate configuration parameters.
         *
  -      * @exception xdoclet.XDocletException Description of Exception
  +     * @exception XDocletException
         */
  -     public void validateOptions() throws XDocletException {
  +    public void validateOptions() throws XDocletException
  +    {
                super.validateOptions();
   
                if (getHomeClassPattern() == null || 
getHomeClassPattern().trim().equals("")) {
  @@ -135,11 +132,12 @@
         *
         * @param clazz Describe what the parameter does
         * @return The GeneratedFileName value
  -      * @exception xdoclet.XDocletException Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for exception
         */
  -     protected String getGeneratedFileName(XClass clazz) throws XDocletException {
  +    protected String getGeneratedFileName(XClass clazz) throws XDocletException
  +    {
                return 
PackageTagsHandler.packageNameAsPathFor(HomeTagsHandler.getHomeInterface("remote", 
getCurrentClass())) + ".java";
        }
   
  @@ -149,21 +147,22 @@
         *
         * @param clazz Describe what the parameter does
         * @return Describe the return value
  -      * @exception xdoclet.XDocletException Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for method parameter
         * @todo-javadoc Write javadocs for return value
         * @todo-javadoc Write javadocs for exception
         */
  -     protected boolean matchesGenerationRules(XClass clazz) throws XDocletException 
{
  +    protected boolean matchesGenerationRules(XClass clazz) throws XDocletException
  +    {
                if (super.matchesGenerationRules(clazz) == false) {
                        return false;
                }
   
  -             Category cat = Log.getCategory(HomeInterfaceSubTask.class, 
"matchesGenerationRules");
  +        Log log = LogUtil.getLog(HomeInterfaceSubTask.class, 
"matchesGenerationRules");
   
                if (InterfaceTagsHandler.isOnlyLocalEjb(getCurrentClass())) {
  -                     cat.debug("Reject file " + clazz.qualifiedName() + " because 
of view-type local");
  +            log.debug("Reject file " + clazz.qualifiedName() + " because of 
view-type local");
                        return false;
                }
   
  @@ -176,7 +175,7 @@
                String generate = interfaceTag.attributeValue("generate");
   
                if ((generate != null) && (generate.indexOf("remote") == -1)) {
  -                     cat.debug("Skip home interface for " + clazz.qualifiedName() + 
" because of generate=" + generate + " flag.");
  +            log.debug("Skip home interface for " + clazz.qualifiedName() + " 
because of generate=" + generate + " flag.");
                        return false;
                }
   
  @@ -187,11 +186,12 @@
        /**
         * Describe what the method does
         *
  -      * @exception xdoclet.XDocletException Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc Write javadocs for method
         * @todo-javadoc Write javadocs for exception
         */
  -     protected void engineStarted() throws XDocletException {
  +    protected void engineStarted() throws XDocletException
  +    {
                System.out.println(Translator.getString("xdoclet.ejb.Messages", 
"generating_home_for",
                                new String[]{getCurrentClass().qualifiedName()}));
        }
  
  
  
  1.1.2.4   +965 -1052 
xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/HomeTagsHandler.java
  
  Index: HomeTagsHandler.java
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/HomeTagsHandler.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -w -r1.1.2.3 -r1.1.2.4
  --- HomeTagsHandler.java      28 Apr 2002 08:32:25 -0000      1.1.2.3
  +++ HomeTagsHandler.java      12 May 2002 13:53:29 -0000      1.1.2.4
  @@ -4,37 +4,36 @@
    */
   package xdoclet.modules.ejb.home;
   
  +import java.text.MessageFormat;
  +import java.util.HashSet;
  +import java.util.Properties;
  +import java.util.Set;
  +import java.util.StringTokenizer;
  +
  +import org.apache.commons.logging.Log;
  +
   import xjavadoc.XClass;
   import xjavadoc.XMethod;
   import xjavadoc.XTag;
   
  -import org.apache.log4j.Category;
  -
   import xdoclet.DocletContext;
   import xdoclet.XDocletException;
  -import xdoclet.modules.ejb.home.LocalHomeInterfaceSubTask;
   import xdoclet.modules.ejb.EjbTagsHandler;
  -import xdoclet.modules.ejb.intf.InterfaceTagsHandler;
  -import xdoclet.modules.ejb.session.SessionTagsHandler;
   import xdoclet.modules.ejb.entity.CmpTagsHandler;
   import xdoclet.modules.ejb.entity.PkTagsHandler;
  +import xdoclet.modules.ejb.home.LocalHomeInterfaceSubTask;
  +import xdoclet.modules.ejb.intf.InterfaceTagsHandler;
  +import xdoclet.modules.ejb.session.SessionTagsHandler;
   
  -import xdoclet.util.Log;
  +import xdoclet.util.LogUtil;
   import xdoclet.util.Translator;
   import xdoclet.util.TypeConversionUtil;
   
  -import java.text.MessageFormat;
  -import java.util.Properties;
  -import java.util.Set;
  -import java.util.HashSet;
  -import java.util.StringTokenizer;
  -
   /**
  - * @xdoclet:taghandler namespace="EjbHome"
  - *
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @created   Oct 15, 2001
  - * @version   $Revision: 1.1.2.3 $
  + * @xdoclet:taghandler   namespace="EjbHome"
  + * @version              $Revision: 1.1.2.4 $
    */
   public class HomeTagsHandler extends EjbTagsHandler
   {
  @@ -48,42 +47,43 @@
        private String     currentExceptions;
   
        /**
  -      * Similar to {@link 
src.xdoclet.modules.ejb.intf.InterfaceTagsHandler#getComponentInterface}. Relies on the
  -      * ejb:home tag, which has the following relevant properties:
  +     * Similar to {@link 
src.xdoclet.modules.ejb.intf.InterfaceTagsHandler#getComponentInterface}.
  +     * Relies on the ejb:home tag, which has the following relevant properties:
  +     *
         * <ul>
         *   <li> remote-class: The fully qualified name of the remote class -
         *   overrides all set patterns
  -      *   <li> local-class: The fully qualified name of the local class - overrides
  -      *   all set patterns
  -      *   <li> remote-pattern: The pattern to be used to determine the unqualified
  -      *   name of the remote class
  +     *   <li> local-class: The fully qualified name of the local class -
  +     *   overrides all set patterns
  +     *   <li> remote-pattern: The pattern to be used to determine the
  +     *   unqualified name of the remote class
         *   <li> local-pattern: The pattern to be used to determine the unqualified
         *   name of the local class
  -      *   <li> 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.
  -      *   <li> remote-package: The package the remote home interface is to be placed
  -      *   in
  -      *   <li> local-package: The package the local home interface is to be placed
  -      *   in
  -      *   <li> package: The package the remote and/or local home interface is to be
  -      *   placed in - used where remote- or local- package are not specified.
  +     *   <li> 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.
  +     *   <li> remote-package: The package the remote home interface is to be
  +     *   placed in
  +     *   <li> local-package: The package the local home interface is to be
  +     *   placed in
  +     *   <li> package: The package the remote and/or local home interface is to
  +     *   be placed in - used where remote- or local- package are not specified.
  +     *
         * </ul>
         *
         *
  -      * @param type                  The type of home interface - can be remote or
  -      *      local.
  +     * @param type                  The type of home interface - can be remote
  +     *      or local.
         * @param clazz                 Description of Parameter
         * @return                      The HomeInterface value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static String getHomeInterface( String type, XClass clazz ) throws 
XDocletException
        {
  -             Category cat = Log.getCategory( HomeTagsHandler.class, 
"getHomeInterface" );
  +        Log log = LogUtil.getLog(HomeTagsHandler.class, "getHomeInterface");
   
                // validate type
  -             if( !"remote".equals( type ) && !"local".equals( type ) )
  -             {
  +        if (!"remote".equals(type) && !"local".equals(type)) {
                        throw new XDocletException( Translator.getString( 
"xdoclet.ejb.Messages",
                                "method_only_takes_remote_or_local", new 
String[]{"getHomeInterface", type} ) );
                }
  @@ -94,51 +94,42 @@
                String home_interface = null;
   
                home_interface = clazz.doc().tagAttributeValue( "ejb:home", type + 
"-class" );
  -             if( cat.isDebugEnabled() )
  -             {
  -                     cat.debug( type + " home Interface for " + 
clazz.qualifiedName() + " = " + home_interface );
  +        if (log.isDebugEnabled()) {
  +            log.debug(type + " home Interface for " + clazz.qualifiedName() + " = " 
+ home_interface);
                }
   
  -             if( home_interface != null )
  -             {
  +        if (home_interface != null) {
                        return home_interface;
                }
   
                name_pattern = clazz.doc().tagAttributeValue( "ejb:home", type + 
"-pattern" );
  -             if( name_pattern == null )
  -             {
  +        if (name_pattern == null) {
                        name_pattern = clazz.doc().tagAttributeValue( "ejb:home", 
"pattern" );
  -                     if( name_pattern == null )
  -                     {
  +            if (name_pattern == null) {
                                name_pattern = "remote".equals( type ) ? 
getHomeClassPattern() : getLocalHomeClassPattern();
                        }
                }
   
                package_pattern = clazz.doc().tagAttributeValue( "ejb:home", type + 
"-package" );
  -             if( package_pattern == null )
  -             {
  +        if (package_pattern == null) {
                        package_pattern = clazz.doc().tagAttributeValue( "ejb:home", 
"package" );
                }
   
                String ejb_name = null;
   
  -             if( name_pattern.indexOf( "{0}" ) != -1 )
  -             {
  +        if (name_pattern.indexOf("{0}") != -1) {
                        ejb_name = MessageFormat.format( name_pattern, new 
Object[]{getShortEjbNameFor( clazz )} );
                }
  -             else
  -             {
  +        else {
                        ejb_name = name_pattern;
                }
   
                String subtask_name = null;
   
  -             if( type.equals( "remote" ) )
  -             {
  +        if (type.equals("remote")) {
                        subtask_name = HomeInterfaceSubTask.SUBTASK_NAME;
                }
  -             else
  -             {
  +        else {
                        subtask_name = LocalHomeInterfaceSubTask.SUBTASK_NAME;
                }
   
  @@ -154,7 +145,7 @@
         *
         * @param method                Description of Parameter
         * @return                      The RemoveMethod value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static boolean isRemoveMethod( XMethod method ) throws XDocletException
        {
  @@ -167,7 +158,7 @@
         *
         * @param method                Description of Parameter
         * @return                      The CreateMethod value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static boolean isCreateMethod( XMethod method ) throws XDocletException
        {
  @@ -175,12 +166,12 @@
        }
   
        /**
  -      * Returns true if method is a home method marked with a ejb:home-method tag,
  -      * false otherwise.
  +     * Returns true if method is a home method marked with a ejb:home-method
  +     * tag, false otherwise.
         *
         * @param method                Description of Parameter
         * @return                      The HomeMethod value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static boolean isHomeMethod( XMethod method ) throws XDocletException
        {
  @@ -193,7 +184,7 @@
         * @param clazz                 Describe what the parameter does
         * @param type                  Describe what the parameter does
         * @return                      The CompNameFor value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for exception
  @@ -202,8 +193,7 @@
        {
                String compName = getEjbNameFor( clazz ).replace( '.', '/' );
   
  -             if( type.equals( "local" ) && isLocalEjb( clazz ) && isRemoteEjb( 
clazz ) )
  -             {
  +        if (type.equals("local") && isLocalEjb(clazz) && isRemoteEjb(clazz)) {
                        compName = compName + LOCAL_SUFFIX;
                }
   
  @@ -215,7 +205,7 @@
         *
         * @param method                Description of Parameter
         * @return                      The FinderMethod value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static boolean isFinderMethod( XMethod method ) throws XDocletException
        {
  @@ -230,7 +220,7 @@
         * @param tagType               Describe what the parameter does
         * @param type                  Describe what the parameter does
         * @return                      The HomeDefinition value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for method parameter
  @@ -243,26 +233,22 @@
                String methodName = method.name().substring( 3 );
                StringBuffer homeMethodName = new StringBuffer();
   
  -             if( tagType.equals( "ejb:finder" ) )
  -             {
  +        if (tagType.equals("ejb:finder")) {
                        String ejbReturn = method.returnType().toString();
   
  -                     if( ejbReturn.equals( "java.util.Collection" ) )
  -                     {
  +            if (ejbReturn.equals("java.util.Collection")) {
                                homeMethodName.append( ejbReturn );
   
                        }
                        // end of if ()
  -                     else
  -                     {
  +            else {
                                homeMethodName.append( 
InterfaceTagsHandler.getComponentInterface( type, clazz ) );
   
                        }
                        // end of else
   
                }
  -             else if( tagType.equals( "ejb:create-method" ) )
  -             {
  +        else if (tagType.equals("ejb:create-method")) {
                        homeMethodName.append( 
InterfaceTagsHandler.getComponentInterface( type, clazz ) );
                }
                homeMethodName.append( " " );
  @@ -273,11 +259,9 @@
                StringTokenizer st = new StringTokenizer( 
method.signature().substring( 1, method.signature().length() - 1 ), "," );
                int k = 1;
   
  -             while( st.hasMoreTokens() )
  -             {
  +        while (st.hasMoreTokens()) {
                        homeMethodName.append( st.nextToken() ).append( " " ).append( 
"param" ).append( k++ );
  -                     if( st.hasMoreTokens() )
  -                     {
  +            if (st.hasMoreTokens()) {
                                homeMethodName.append( " , " );
                        }
                }
  @@ -286,12 +270,12 @@
        }
   
        /**
  -      * Converts ejbHome<em>blabla</em> to home<em>blabla</em> , the one that should
  -      * appear in home interface.
  +     * Converts ejbHome<em>blabla</em> to home<em>blabla</em> , the one that
  +     * should appear in home interface.
         *
         * @param methodName            Description of Parameter
         * @return                      Description of the Returned Value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static String toHomeMethod( String methodName ) throws XDocletException
        {
  @@ -305,17 +289,15 @@
         *
         * @param methodName            Description of Parameter
         * @return                      Description of the Returned Value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static String toCreateMethod( String methodName ) throws 
XDocletException
        {
  -             if( methodName.length() > 9 )
  -             {
  +        if (methodName.length() > 9) {
                        // Remove "ejbCreate" prefix and lower case first char in 
rest: "ejbCreateFoo"->"createFoo", EJB 2 only
                        return "create" + Character.toUpperCase( methodName.charAt( 9 
) ) + methodName.substring( 10 );
                }
  -             else
  -             {
  +        else {
                        return "create";
                }
        }
  @@ -325,7 +307,7 @@
         *
         * @param clazz                 Describe what the parameter does
         * @return                      Describe the return value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for return value
  @@ -335,14 +317,11 @@
        {
                XMethod[] methods = clazz.methods();
   
  -             do
  -             {
  -                     for( int i = 0; i < methods.length; i++ )
  -                     {
  +        do {
  +            for (int i = 0; i < methods.length; i++) {
                                XMethod method = methods[i];
   
  -                             if( HomeTagsHandler.isCreateMethod( method ) )
  -                             {
  +                if (HomeTagsHandler.isCreateMethod(method)) {
                                        return method;
                                }
                        }
  @@ -354,12 +333,12 @@
        }
   
        /**
  -      * Converts ejbFind<em>blabla</em> to find<em>blabla</em> , the one that should
  -      * appear in home interface.
  +     * Converts ejbFind<em>blabla</em> to find<em>blabla</em> , the one that
  +     * should appear in home interface.
         *
         * @param methodName            Description of Parameter
         * @return                      Description of the Returned Value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static String toFinderMethod( String methodName ) throws 
XDocletException
        {
  @@ -382,20 +361,16 @@
                String sign = st.nextToken();
                StringBuffer ret = new StringBuffer();
   
  -             if( sign.equals( "Collection" ) )
  -             {
  +        if (sign.equals("Collection")) {
                        ret.append( "java.util.Collection" );
                }
  -             else if( sign.equals( "Enumeration" ) )
  -             {
  +        else if (sign.equals("Enumeration")) {
                        ret.append( "java.util.Enumeration" );
                }
  -             else
  -             {
  +        else {
                        ret.append( sign );
                }
  -             while( st.hasMoreTokens() )
  -             {
  +        while (st.hasMoreTokens()) {
                        ret.append( " " ).append( st.nextToken() );
                }
                return ret.toString();
  @@ -410,12 +385,10 @@
        {
                LocalHomeInterfaceSubTask localhomeintf_subtask = ( ( 
LocalHomeInterfaceSubTask ) DocletContext.getInstance().getSubTaskBy( 
LocalHomeInterfaceSubTask.SUBTASK_NAME ) );
   
  -             if( localhomeintf_subtask != null )
  -             {
  +        if (localhomeintf_subtask != null) {
                        return localhomeintf_subtask.getLocalHomeClassPattern();
                }
  -             else
  -             {
  +        else {
                        return 
LocalHomeInterfaceSubTask.DEFAULT_LOCALHOMEINTERFACE_CLASS_PATTERN;
                }
        }
  @@ -429,27 +402,25 @@
        {
                HomeInterfaceSubTask homeintf_subtask = ( ( HomeInterfaceSubTask ) 
DocletContext.getInstance().getSubTaskBy( HomeInterfaceSubTask.SUBTASK_NAME ) );
   
  -             if( homeintf_subtask != null )
  -             {
  +        if (homeintf_subtask != null) {
                        return homeintf_subtask.getHomeClassPattern();
                }
  -             else
  -             {
  +        else {
                        return 
HomeInterfaceSubTask.DEFAULT_HOMEINTERFACE_CLASS_PATTERN;
                }
        }
   
        /**
  -      * Returns the full qualified local or remote home interface name for the bean,
  -      * depending on the value of type parameter.
  +     * Returns the full qualified local or remote home interface name for the
  +     * bean, depending on the value of type parameter.
         *
         * @param attributes            The attributes of the template tag
         * @return                      Description of the Returned Value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         * @doc:tag                     type="content"
         * @doc:param                   name="type" optional="false"
  -      *      values="remote,local" description="Specifies the type of component home
  -      *      interface."
  +     *      values="remote,local" description="Specifies the type of component
  +     *      home interface."
         */
        public String homeInterface( Properties attributes ) throws XDocletException
        {
  @@ -466,8 +437,9 @@
         *
         * @param template              The body of the block tag
         * @param attributes            The attributes of the template tag
  -      * @exception xdoclet.XDocletException  Description of Exception
  -      * @todo                        I commented somehting strange but surely needed
  +     * @exception XDocletException
  +     * @todo                        I commented somehting strange but surely
  +     *      needed
         * @see                         #isCreateMethod(xjavadoc.XMethod)
         * @doc:tag                     type="block"
         * @doc:param                   name="superclasses" optional="true"
  @@ -479,13 +451,11 @@
                String superclasses_str = attributes.getProperty( "superclasses" );
                boolean superclasses = TypeConversionUtil.stringToBoolean( 
superclasses_str, true );
   
  -             if( isCreateMethod( getCurrentMethod() ) )
  -             {
  +        if (isCreateMethod(getCurrentMethod())) {
                        boolean currentMethodDoesntBelongToCurrentClass = 
!getCurrentMethod().containingClass().equals( getCurrentClass() );
                        boolean shouldTraverse = 
shouldTraverseSuperclassForDependentClass( getCurrentMethod().containingClass(), 
"ejb:home" );
   
  -                     if( superclasses == false && 
currentMethodDoesntBelongToCurrentClass == true && shouldTraverse == false )
  -                     {
  +            if (superclasses == false && currentMethodDoesntBelongToCurrentClass == 
true && shouldTraverse == false) {
                                return;
                        }
   
  @@ -499,7 +469,7 @@
         *
         * @param template              The body of the block tag
         * @param attributes            The attributes of the template tag
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         * @doc:tag                     type="block"
         */
        public void ifDoesntHavePostCreateMethod( String template, Properties 
attributes )
  @@ -507,8 +477,7 @@
        {
                XMethod currentMethod = getCurrentMethod();
   
  -             if( !isCreateMethod( currentMethod ) )
  -             {
  +        if (!isCreateMethod(currentMethod)) {
                        throw new XDocletException( "Cannot call 
ifDoesntHavePostCreateMethod if the current method is not a create method: "
                                 + currentMethod );
                }
  @@ -519,15 +488,14 @@
   
                XMethod ejbPostCreateMethod = getCurrentClass().getMethod( 
currentMethodName.toString() );
   
  -             if( ejbPostCreateMethod == null )
  -             {
  +        if (ejbPostCreateMethod == null) {
                        generate( template );
                }
        }
   
        /**
  -      * Returns the appropriate ejbPostCreate method name for the current ejbCreate
  -      * method.
  +     * 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
  @@ -547,7 +515,7 @@
         *
         * @param template              The body of the block tag
         * @param attributes            The attributes of the template tag
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         * @see                         #isHomeMethod(xjavadoc.XMethod)
         * @doc:tag                     type="block"
         * @doc:param                   name="superclasses" optional="true"
  @@ -559,10 +527,8 @@
                String superclasses_str = attributes.getProperty( "superclasses" );
                boolean superclasses = TypeConversionUtil.stringToBoolean( 
superclasses_str, true );
   
  -             if( isHomeMethod( getCurrentMethod() ) )
  -             {
  -                     if( superclasses == false && 
getCurrentMethod().containingClass() != getCurrentClass() && 
shouldTraverseSuperclassForDependentClass( getCurrentMethod().containingClass(), 
"ejb:home" ) == false )
  -                     {
  +        if (isHomeMethod(getCurrentMethod())) {
  +            if (superclasses == false && getCurrentMethod().containingClass() != 
getCurrentClass() && 
shouldTraverseSuperclassForDependentClass(getCurrentMethod().containingClass(), 
"ejb:home") == false) {
                                return;
                        }
   
  @@ -574,14 +540,13 @@
         * Evaluates the body block if current method is ejbRemove method.
         *
         * @param template              The body of the block tag
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         * @see                         #isRemoveMethod(xjavadoc.XMethod)
         * @doc:tag                     type="block"
         */
        public void ifNotRemoveMethod( String template ) throws XDocletException
        {
  -             if( !isRemoveMethod( getCurrentMethod() ) )
  -             {
  +        if (!isRemoveMethod(getCurrentMethod())) {
                        generate( template );
                }
        }
  @@ -615,14 +580,14 @@
        /**
         * @param attributes            The attributes of the template tag
         * @return                      Description of the Returned Value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception 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."
         * @doc:param                   name="type" optional="false"
  -      *      values="remote,local" description="Specifies if we want the jndi name
  -      *      value for local or remote lookup."
  +     *      values="remote,local" description="Specifies if we want the jndi
  +     *      name value for local or remote lookup."
         */
        public String compName( Properties attributes ) throws XDocletException
        {
  @@ -634,12 +599,10 @@
   
                String compName;
   
  -             if( prefix_with_ejbslash == true )
  -             {
  +        if (prefix_with_ejbslash == true) {
                        compName = prefixWithEjbSlash( ejb_name );
                }
  -             else
  -             {
  +        else {
                        compName = ejb_name;
                }
   
  @@ -649,11 +612,11 @@
        /**
         * @param attributes
         * @return                      Description of the Returned Value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception 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."
  +     *      values="remote,local" description="Specifies if we want the jndi
  +     *      name value for local or remote lookup."
         */
        public String jndiName( Properties attributes ) throws XDocletException
        {
  @@ -661,14 +624,12 @@
                XTag bean_tag = getCurrentClass().doc().tag( "ejb:bean" );
                String compName = getCompNameFor( getCurrentClass(), type );
   
  -             if( bean_tag != null )
  -             {
  +        if (bean_tag != null) {
                        String jndiName = dereferenceProperties( 
bean_tag.attributeValue( "jndi-name" ) );
                        String localJndiName = dereferenceProperties( 
bean_tag.attributeValue( "local-jndi-name" ) );
   
                        //Return "local" jndi name
  -                     if( "local".equals( type ) )
  -                     {
  +            if ("local".equals(type)) {
                                return localJndiName != null ? localJndiName : 
compName;
                        }
   
  @@ -685,7 +646,7 @@
         *
         * @param attributes
         * @return                      The name of generated PK class.
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         * @doc:tag                     type="content"
         */
        public String extendsFrom( Properties attributes ) throws XDocletException
  @@ -705,28 +666,27 @@
         *
         * @param template              The body of the block tag
         * @param attributes            The attributes of the template tag
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         * @todo                        skip EJBException as we do in home.j for
         *      home-methods
         * @doc:tag                     type="block"
         * @doc:param                   name="tagName" optional="false"
         *      description="The tag name."
         * @doc:param                   name="superclasses" values="true,false"
  -      *      description="If true then traverse superclasses also, otherwise look up
  -      *      the tag in current concrete class only."
  -      * @doc:param                   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."
  +     *      description="If true then traverse superclasses also, otherwise look
  +     *      up the tag in current concrete class only."
  +     * @doc:param                   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."
         */
        public void forAllHomeMethods( String template, Properties attributes ) throws 
XDocletException
        {
  -             Category cat = Log.getCategory( HomeTagsHandler.class, 
"forAllHomeMethods" );
  +        Log log = LogUtil.getLog(HomeTagsHandler.class, "forAllHomeMethods");
                boolean superclasses = TypeConversionUtil.stringToBoolean( 
attributes.getProperty( "superclasses" ), false );
                String type = attributes.getProperty( "type" );
                String tagType = attributes.getProperty( "tagName" );
   
  -             if( type == null )
  -             {
  +        if (type == null) {
                        throw new XDocletException( "Attribute 'type' is mandatory for 
'forAllFinders'" );
                }
   
  @@ -735,40 +695,32 @@
                // Exclude definition coming from super classes
                XClass currentClass = getCurrentClass().superclass();
   
  -             while( currentClass != null )
  -             {
  -                     if( cat.isDebugEnabled() )
  -                     {
  -                             cat.debug( "Looking for super definition in " + 
currentClass.name() );
  +        while (currentClass != null) {
  +            if (log.isDebugEnabled()) {
  +                log.debug("Looking for super definition in " + currentClass.name());
                        }
   
                        // 1. METHOD tags
                        XMethod[] methods = currentClass.methods();
   
  -                     for( int i = 0; i < methods.length; i++ )
  -                     {
  +            for (int i = 0; i < methods.length; i++) {
                                XMethod method = methods[i];
   
  -                             if( tagType.equals( "ejb:finder" ) )
  -                             {
  -                                     if( !isFinderMethod( method ) )
  -                                     {
  +                if (tagType.equals("ejb:finder")) {
  +                    if (!isFinderMethod(method)) {
                                                continue;
                                        }
                                }
  -                             else if( tagType.equals( "ejb:create-method" ) )
  -                             {
  -                                     if( !isCreateMethod( method ) )
  -                                     {
  +                else if (tagType.equals("ejb:create-method")) {
  +                    if (!isCreateMethod(method)) {
                                                continue;
                                        }
                                }
   
                                String signature = getHomeDefinition( currentClass, 
method, tagType, type );
   
  -                             if( cat.isDebugEnabled() )
  -                             {
  -                                     cat.debug( "Found " + signature );
  +                if (log.isDebugEnabled()) {
  +                    log.debug("Found " + signature);
                                }
                                already.add( signature );
                        }
  @@ -776,16 +728,13 @@
                        // 2. CLASS tags
                        XTag[] superTags = currentClass.doc().tags( tagType, true );
   
  -                     for( int i = 0; i < superTags.length; i++ )
  -                     {
  +            for (int i = 0; i < superTags.length; i++) {
                                String signature = fullPackageChange( 
superTags[i].attributeValue( "signature" ) );
                                String typeMapping = superTags[i].attributeValue( 
"result-type-mapping" );
   
  -                             if( typeMapping == null || 
typeMapping.equalsIgnoreCase( type ) )
  -                             {
  -                                     if( cat.isDebugEnabled() )
  -                                     {
  -                                             cat.debug( "Found " + signature );
  +                if (typeMapping == null || typeMapping.equalsIgnoreCase(type)) {
  +                    if (log.isDebugEnabled()) {
  +                        log.debug("Found " + signature);
                                        }
                                        already.add( signature );
                                }
  @@ -797,96 +746,77 @@
                XMethod[] methods = getCurrentClass().methods();
                boolean fbpkFound = false;
   
  -             for( int i = 0; i < methods.length; i++ )
  -             {
  +        for (int i = 0; i < methods.length; i++) {
                        XMethod method = methods[i];
                        String signature = null;
   
  -                     if( tagType.equals( "ejb:finder" ) )
  -                     {
  -                             if( !isFinderMethod( method ) )
  -                             {
  +            if (tagType.equals("ejb:finder")) {
  +                if (!isFinderMethod(method)) {
                                        continue;
                                }
                                signature = getHomeDefinition( getCurrentClass(), 
method, tagType, type );
   
  -                             if( !already.add( signature ) )
  -                             {
  +                if (!already.add(signature)) {
                                        continue;
                                }
   
  -                             if( cat.isDebugEnabled() )
  -                             {
  -                                     cat.debug( "Finder Method = " + signature );
  +                if (log.isDebugEnabled()) {
  +                    log.debug("Finder Method = " + signature);
                                }
                        }
  -                     else if( tagType.equals( "ejb:create-method" ) )
  -                     {
  -                             if( !isCreateMethod( method ) )
  -                             {
  +            else if (tagType.equals("ejb:create-method")) {
  +                if (!isCreateMethod(method)) {
                                        continue;
                                }
   
                                String viewType = null;
                                XTag[] tags = method.doc().tags( tagType, superclasses 
);
   
  -                             for( int k = 0; k < tags.length; k++ )
  -                             {
  +                for (int k = 0; k < tags.length; k++) {
                                        String attr = tags[k].attributeValue( 
"view-type" );
   
  -                                     if( attr != null )
  -                                     {
  +                    if (attr != null) {
                                                viewType = attr;
                                        }
                                }
   
  -                             if( viewType != null && !viewType.equals( "both" ) && 
!viewType.equals( type ) )
  -                             {
  +                if (viewType != null && !viewType.equals("both") && 
!viewType.equals(type)) {
                                        continue;
                                }
   
                                signature = getHomeDefinition( getCurrentClass(), 
method, tagType, type );
   
  -                             if( !already.add( signature ) )
  -                             {
  +                if (!already.add(signature)) {
                                        continue;
                                }
   
  -                             if( cat.isDebugEnabled() )
  -                             {
  -                                     cat.debug( "Create Method = " + signature );
  +                if (log.isDebugEnabled()) {
  +                    log.debug("Create Method = " + signature);
                                }
                        }
  -                     if( signature != null )
  -                     {
  +            if (signature != null) {
                                setCurrentSignature( signature );
   
                                XClass[] exceptions = method.thrownExceptions();
                                StringBuffer exc = new StringBuffer();
   
  -                             for( int j = 0; j < exceptions.length; j++ )
  -                             {
  +                for (int j = 0; j < exceptions.length; j++) {
                                        XClass exception = exceptions[j];
   
                                        exc.append( exception.qualifiedName() );
  -                                     if( j != exceptions.length - 1 )
  -                                     {
  +                    if (j != exceptions.length - 1) {
                                                exc.append( ',' );
                                        }
                                }
  -                             if( exc.length() == 0 )
  -                             {
  -                                     if( tagType.equals( "ejb:finder" ) )
  -                                     {
  +                if (exc.length() == 0) {
  +                    if (tagType.equals("ejb:finder")) {
                                                exc.append( 
"javax.ejb.FinderException" );
                                        }
  -                                     else if( tagType.equals( "ejb:create-method" ) 
)
  -                                     {
  +                    else if (tagType.equals("ejb:create-method")) {
                                                exc.append( 
"javax.ejb.CreateException" );
                                        }
                                }
  -                             if( type.equalsIgnoreCase( "remote" ) )
  -                             {
  +                if (type.equalsIgnoreCase("remote")) {
                                        exc.append( ",java.rmi.RemoteException" );
                                }
                                setCurrentExceptions( exc.toString() );
  @@ -895,8 +825,7 @@
   
                                // If custom findByPrimaryKey exists then we should 
not add the
                                // mandatory later
  -                             if( method.name().equals( "findByPrimaryKey" ) )
  -                             {
  +                if (method.name().equals("findByPrimaryKey")) {
                                        fbpkFound = true;
                                }
   
  @@ -907,25 +836,20 @@
                // 2. Handle CLASS Tag level ejb:finder
                XTag[] tags = getCurrentClass().doc().tags( tagType, superclasses );
   
  -             for( int i = 0; i < tags.length; i++ )
  -             {
  +        for (int i = 0; i < tags.length; i++) {
                        String signature = fullPackageChange( tags[i].attributeValue( 
"signature" ) );
                        String typeMapping = tags[i].attributeValue( 
"result-type-mapping" );
   
  -                     if( typeMapping == null || typeMapping.equalsIgnoreCase( type 
) )
  -                     {
  -                             if( !already.add( signature ) )
  -                             {
  +            if (typeMapping == null || typeMapping.equalsIgnoreCase(type)) {
  +                if (!already.add(signature)) {
                                        continue;
                                }
   
  -                             if( cat.isDebugEnabled() )
  -                             {
  -                                     cat.debug( "Finder Method = " + signature );
  +                if (log.isDebugEnabled()) {
  +                    log.debug("Finder Method = " + signature);
                                }
   
  -                             if( signature.indexOf( "findByPrimaryKey" ) != -1 )
  -                             {
  +                if (signature.indexOf("findByPrimaryKey") != -1) {
                                        fbpkFound = true;
                                }
   
  @@ -935,8 +859,7 @@
                                StringBuffer exc = new StringBuffer();
   
                                exc.append( "javax.ejb.FinderException" );
  -                             if( type.equalsIgnoreCase( "remote" ) )
  -                             {
  +                if (type.equalsIgnoreCase("remote")) {
                                        exc.append( ",java.rmi.RemoteException" );
                                }
                                setCurrentExceptions( exc.toString() );
  @@ -946,21 +869,18 @@
                }
   
                // Add mandatory findByPrimaryKey if not already there
  -             if( !fbpkFound && CmpTagsHandler.isEntityCmp( getCurrentClass() ) && 
tagType.equals( "ejb:finder" ) )
  -             {
  +        if (!fbpkFound && CmpTagsHandler.isEntityCmp(getCurrentClass()) && 
tagType.equals("ejb:finder")) {
                        StringBuffer fbpkSign = new StringBuffer( 
InterfaceTagsHandler.getComponentInterface( type, getCurrentClass() ) );
   
                        fbpkSign.append( " findByPrimaryKey(" );
                        fbpkSign.append( PkTagsHandler.getPkClassFor( 
getCurrentClass() ) ).append( " pk" ).append( ")" );
  -                     if( already.add( fbpkSign ) )
  -                     {
  +            if (already.add(fbpkSign)) {
                                setCurrentSignature( fbpkSign.toString() );
   
                                StringBuffer exc = new StringBuffer();
   
                                exc.append( "javax.ejb.FinderException" );
  -                             if( type.equalsIgnoreCase( "remote" ) )
  -                             {
  +                if (type.equalsIgnoreCase("remote")) {
                                        exc.append( ",java.rmi.RemoteException" );
                                }
   
  @@ -971,10 +891,8 @@
                }
   
                // Add mandatory create() method for stateless beans
  -             if( SessionTagsHandler.isSession( getCurrentClass() ) && 
tagType.equals( "ejb:create-method" ) )
  -             {
  -                     if( already.size() == 0 )
  -                     {
  +        if (SessionTagsHandler.isSession(getCurrentClass()) && 
tagType.equals("ejb:create-method")) {
  +            if (already.size() == 0) {
                                StringBuffer createSign = new StringBuffer( 
InterfaceTagsHandler.getComponentInterface( type, getCurrentClass() ) );
   
                                createSign.append( " create()" );
  @@ -983,8 +901,7 @@
                                StringBuffer exc = new StringBuffer();
   
                                exc.append( "javax.ejb.CreateException" );
  -                             if( type.equalsIgnoreCase( "remote" ) )
  -                             {
  +                if (type.equalsIgnoreCase("remote")) {
                                        exc.append( ",java.rmi.RemoteException" );
                                }
                                setCurrentExceptions( exc.toString() );
  @@ -1005,7 +922,7 @@
         * Describe what the method does
         *
         * @return                      Describe the return value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method
         * @todo-javadoc                Write javadocs for return value
         * @todo-javadoc                Write javadocs for exception
  @@ -1019,7 +936,7 @@
         * Describe what the method does
         *
         * @return                      Describe the return value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method
         * @todo-javadoc                Write javadocs for return value
         * @todo-javadoc                Write javadocs for exception
  @@ -1035,19 +952,17 @@
         * @param clazz                 Describe what the parameter does
         * @param type                  Describe what the parameter does
         * @return                      The DependentClassFor value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for exception
         */
        protected String getDependentClassFor( XClass clazz, String type ) throws 
XDocletException
        {
  -             if( ( type.equals( "local" ) && InterfaceTagsHandler.isLocalEjb( clazz 
) ) || ( type.equals( "remote" ) && InterfaceTagsHandler.isRemoteEjb( clazz ) ) )
  -             {
  +        if ((type.equals("local") && InterfaceTagsHandler.isLocalEjb(clazz)) || 
(type.equals("remote") && InterfaceTagsHandler.isRemoteEjb(clazz))) {
                        return getHomeInterface( type, clazz );
                }
  -             else
  -             {
  +        else {
                        return null;
                }
        }
  @@ -1078,7 +993,7 @@
         * @param clazz                 Describe what the parameter does
         * @param tag_name              Describe what the parameter does
         * @return                      Describe the return value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for method parameter
  @@ -1087,14 +1002,12 @@
         */
        protected boolean shouldTraverseSuperclassForDependentClass( XClass clazz, 
String tag_name ) throws XDocletException
        {
  -             if( super.shouldTraverseSuperclassForDependentClass( clazz, tag_name ) 
== false )
  -             {
  +        if (super.shouldTraverseSuperclassForDependentClass(clazz, tag_name) == 
false) {
                        return false;
                }
   
                //shouldn't include create methods of parent if parent is itself a 
concrete ejb
  -             if( isAConcreteEJBean( clazz ) )
  -             {
  +        if (isAConcreteEJBean(clazz)) {
                        return false;
                }
   
  
  
  
  1.1.2.6   +166 -183  
xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/LocalHomeInterfaceSubTask.java
  
  Index: LocalHomeInterfaceSubTask.java
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/LocalHomeInterfaceSubTask.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -w -r1.1.2.5 -r1.1.2.6
  --- LocalHomeInterfaceSubTask.java    2 May 2002 20:20:30 -0000       1.1.2.5
  +++ LocalHomeInterfaceSubTask.java    12 May 2002 13:53:29 -0000      1.1.2.6
  @@ -4,54 +4,44 @@
    */
   package xdoclet.modules.ejb.home;
   
  +import java.io.File;
  +
  +import org.apache.commons.logging.Log;
  +
   import xjavadoc.XClass;
   import xjavadoc.XTag;
   
  -import org.apache.log4j.Category;
  -
   import xdoclet.TemplateSubTask;
   import xdoclet.XDocletException;
   import xdoclet.XDocletTagSupport;
  -import xdoclet.tagshandler.PackageTagsHandler;
  -
  -import xdoclet.util.Log;
  -import xdoclet.util.Translator;
  -
  -import java.io.File;
   
   import xdoclet.modules.ejb.AbstractEjbCodeGeneratorSubTask;
   import xdoclet.modules.ejb.intf.InterfaceTagsHandler;
  +import xdoclet.tagshandler.PackageTagsHandler;
  +
  +import xdoclet.util.LogUtil;
  +import xdoclet.util.Translator;
   
   /**
  - * @xdoclet:subtask name="localhomeinterface" 
parent="xdoclet.modules.ejb.EjbDocletTask"
  - *
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @created   Oct 15, 2001
  - * @version   $Revision: 1.1.2.5 $
  + * @xdoclet:subtask   name="localhomeinterface"
  + *      parent="xdoclet.modules.ejb.EjbDocletTask"
  + * @version           $Revision: 1.1.2.6 $
    */
   public class LocalHomeInterfaceSubTask extends AbstractEjbCodeGeneratorSubTask
   {
  -
  -     /**
  -      * @todo-javadoc   Describe the field
  -      */
        public final static String SUBTASK_NAME = "localHomeInterface";
   
  -     /**
  -      * @todo-javadoc   Describe the field
  -      */
        public final static String DEFAULT_LOCALHOMEINTERFACE_CLASS_PATTERN = 
"{0}LocalHome";
   
  -     /**
  -      * @todo-javadoc   Describe the field
  -      */
        protected static String DEFAULT_TEMPLATE_FILE = "resources/home-local.xdt";
   
        /**
         * A configuration parameter for specifying the local home interface name
  -      * pattern. By default the value is used for deciding the local home interface
  -      * name. {0} in the value mean current class's symbolic name which for an
  -      * EJBean is the EJB name.
  +     * pattern. By default the value is used for deciding the local home
  +     * interface name. {0} in the value mean current class's symbolic name which
  +     * for an EJBean is the EJB name.
         *
         * @see   #getLocalHomeClassPattern()
         */
  @@ -80,23 +70,21 @@
        }
   
        /**
  -      * Returns the configuration parameter for specifying the local home interface
  -      * name pattern. By default the value is used for deciding the local home
  -      * interface name. {0} in the value mean current class's symbolic name which
  -      * for an EJBean is the EJB name. If nothing explicitly specified by user then
  -      * "{0}LocalHome" is used by default.
  +     * Returns the configuration parameter for specifying the local home
  +     * interface name pattern. By default the value is used for deciding the
  +     * local home interface name. {0} in the value mean current class's symbolic
  +     * name which for an EJBean is the EJB name. If nothing explicitly specified
  +     * by user then "{0}LocalHome" is used by default.
         *
         * @return   The LocalHomeClassPattern value
         * @see      #localHomeClassPattern
         */
        public String getLocalHomeClassPattern()
        {
  -             if( localHomeClassPattern != null )
  -             {
  +        if (localHomeClassPattern != null) {
                        return localHomeClassPattern;
                }
  -             else
  -             {
  +        else {
                        return DEFAULT_LOCALHOMEINTERFACE_CLASS_PATTERN;
                }
        }
  @@ -114,29 +102,28 @@
        /**
         * Called to validate configuration parameters.
         *
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public void validateOptions() throws XDocletException
        {
                super.validateOptions();
   
  -             if( getLocalHomeClassPattern() == null || 
getLocalHomeClassPattern().trim().equals( "" ) )
  -             {
  +        if (getLocalHomeClassPattern() == null || 
getLocalHomeClassPattern().trim().equals("")) {
                        throw new XDocletException( Translator.getString( 
"parameter_missing_or_empty", new String[]{"pattern"} ) );
                }
   
  -             if( getLocalHomeClassPattern().indexOf( "{0}" ) == -1 )
  -             {
  +        if (getLocalHomeClassPattern().indexOf("{0}") == -1) {
                        throw new XDocletException( Translator.getString( 
"xdoclet.ejb.Messages", "pattern_has_no_placeholder" ) );
                }
        }
   
        /**
  -      * Gets the GeneratedFileName attribute of the LocalHomeInterfaceSubTask object
  +     * Gets the GeneratedFileName attribute of the LocalHomeInterfaceSubTask
  +     * object
         *
         * @param clazz                 Describe what the parameter does
         * @return                      The GeneratedFileName value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for exception
         */
  @@ -150,7 +137,7 @@
         *
         * @param clazz                 Describe what the parameter does
         * @return                      Describe the return value
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method
         * @todo-javadoc                Write javadocs for method parameter
         * @todo-javadoc                Write javadocs for return value
  @@ -158,31 +145,27 @@
         */
        protected boolean matchesGenerationRules( XClass clazz ) throws 
XDocletException
        {
  -             if( super.matchesGenerationRules( clazz ) == false )
  -             {
  +        if (super.matchesGenerationRules(clazz) == false) {
                        return false;
                }
   
  -             Category cat = Log.getCategory( LocalHomeInterfaceSubTask.class, 
"matchesGenerationRules" );
  +        Log log = LogUtil.getLog(LocalHomeInterfaceSubTask.class, 
"matchesGenerationRules");
   
  -             if( InterfaceTagsHandler.isOnlyRemoteEjb( getCurrentClass() ) )
  -             {
  -                     cat.debug( "Reject file " + clazz.qualifiedName() + " because 
of view-type remote" );
  +        if (InterfaceTagsHandler.isOnlyRemoteEjb(getCurrentClass())) {
  +            log.debug("Reject file " + clazz.qualifiedName() + " because of 
view-type remote");
                        return false;
                }
   
                XTag interfaceTag = getCurrentClass().doc().tag( "ejb:interface" );
   
  -             if( interfaceTag == null )
  -             {
  +        if (interfaceTag == null) {
                        return true;
                }
   
                String generate = interfaceTag.attributeValue( "generate" );
   
  -             if( generate != null && generate.indexOf( "local" ) == -1 )
  -             {
  -                     cat.debug( "Skip local home interface for " + 
clazz.qualifiedName() + " because of generate=" + generate + " flag." );
  +        if (generate != null && generate.indexOf("local") == -1) {
  +            log.debug("Skip local home interface for " + clazz.qualifiedName() + " 
because of generate=" + generate + " flag.");
                        return false;
                }
   
  @@ -192,7 +175,7 @@
        /**
         * Describe what the method does
         *
  -      * @exception xdoclet.XDocletException  Describe the exception
  +     * @exception XDocletException
         * @todo-javadoc                Write javadocs for method
         * @todo-javadoc                Write javadocs for exception
         */
  
  
  

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to