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

  Modified:    modules/ejb/src/xdoclet/modules/ejb/lookup Tag:
                        MODULE_REFACTORING_BRANCH LookupObjectSubTask.java
                        LookupUtilTagsHandler.java
  Log:
  Refactored. Fixed compilation errors and warnings.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +269 -276  
xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/Attic/LookupObjectSubTask.java
  
  Index: LookupObjectSubTask.java
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/Attic/LookupObjectSubTask.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
  --- LookupObjectSubTask.java  2 May 2002 20:20:30 -0000       1.1.2.5
  +++ LookupObjectSubTask.java  12 May 2002 13:53:29 -0000      1.1.2.6
  @@ -4,25 +4,24 @@
    */
   package xdoclet.modules.ejb.lookup;
   
  +import org.apache.commons.logging.Log;
  +
   import xjavadoc.XClass;
   
   import xdoclet.XDocletException;
   import xdoclet.XDocletTagSupport;
  -import xdoclet.util.Log;
  -
  -import xdoclet.util.Translator;
  -import xdoclet.tagshandler.PackageTagsHandler;
  -
  -import org.apache.log4j.Category;
   import xdoclet.modules.ejb.AbstractEjbCodeGeneratorSubTask;
   import xdoclet.modules.ejb.EjbTagsHandler;
  +import xdoclet.tagshandler.PackageTagsHandler;
  +import xdoclet.util.LogUtil;
  +
  +import xdoclet.util.Translator;
   
   /**
  - * @xdoclet:subtask name="utilobject" parent="xdoclet.modules.ejb.EjbDocletTask"
  - *
    * @author    Konstantin Pribluda
    * @created   October 3, 2001
  - * @version   $Revision: 1.1.2.5 $
  + * @xdoclet:subtask   name="utilobject" parent="xdoclet.modules.ejb.EjbDocletTask"
  + * @version           $Revision: 1.1.2.6 $
    */
   public class LookupObjectSubTask extends AbstractEjbCodeGeneratorSubTask
   {
  @@ -43,9 +42,10 @@
        private static String DEFAULT_TEMPLATE_FILE = "resources/lookup.xdt";
   
        /**
  -      * A configuration parameter for specifying the utility class name pattern. By
  -      * default the value is used for deciding the utility 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 utility class name pattern.
  +     * By default the value is used for deciding the utility name. {0} in the
  +     * value mean current class's symbolic name which for an EJBean is the EJB
  +     * name.
         *
         * @see   #getUtilClassPattern()
         */
  @@ -120,21 +120,19 @@
   
        /**
         * Returns the configuration parameter for specifying the utility class name
  -      * pattern. By default the value is used for deciding the utility 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}Util" is used by
  -      * default.
  +     * pattern. By default the value is used for deciding the utility 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}Util" is
  +     * used by default.
         *
         * @return   The UtilClassPattern value
         */
        public String getUtilClassPattern()
        {
  -             if( utilClassPattern != null )
  -             {
  +        if (utilClassPattern != null) {
                        return utilClassPattern;
                }
  -             else
  -             {
  +        else {
                        return DEFAULT_UTIL_CLASS_PATTERN;
                }
        }
  @@ -182,19 +180,17 @@
        /**
         * Called to validate configuration parameters.
         *
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public void validateOptions() throws XDocletException
        {
                super.validateOptions();
   
  -             if( getUtilClassPattern() == null || 
getUtilClassPattern().trim().equals( "" ) )
  -             {
  +        if (getUtilClassPattern() == null || 
getUtilClassPattern().trim().equals("")) {
                        throw new XDocletException( Translator.getString( 
"parameter_missing_or_empty", new String[]{"pattern"} ) );
                }
   
  -             if( getUtilClassPattern().indexOf( "{0}" ) == -1 )
  -             {
  +        if (getUtilClassPattern().indexOf("{0}") == -1) {
                        throw new XDocletException( Translator.getString( 
"xdoclet.ejb.Messages", "pattern_has_no_placeholder" ) );
                }
        }
  @@ -204,7 +200,7 @@
         *
         * @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
         */
  @@ -216,7 +212,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
         */
  @@ -231,7 +227,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
  @@ -239,25 +235,22 @@
         */
        protected boolean matchesGenerationRules( XClass clazz ) throws 
XDocletException
        {
  -             Category cat = Log.getCategory( LookupObjectSubTask.class, 
"matchesGenerationRules" );
  +        Log log = LogUtil.getLog(LookupObjectSubTask.class, 
"matchesGenerationRules");
   
  -             if( super.matchesGenerationRules( clazz ) == false )
  -             {
  -                     cat.debug( "Skip bean " + clazz.qualifiedName() + " because 
super.matchesGenerationRules() returned false." );
  +        if (super.matchesGenerationRules(clazz) == false) {
  +            log.debug("Skip bean " + clazz.qualifiedName() + " because 
super.matchesGenerationRules() returned false.");
                        return false;
                }
   
  -             if( !EjbTagsHandler.isAConcreteEJBean( getCurrentClass() ) )
  -             {
  -                     cat.debug( "Skip bean " + clazz.qualifiedName() + " because 
it's not a concrete bean." );
  +        if (!EjbTagsHandler.isAConcreteEJBean(getCurrentClass())) {
  +            log.debug("Skip bean " + clazz.qualifiedName() + " because it's not a 
concrete bean.");
                        return false;
                }
   
                String generate = getCurrentClass().doc().tagAttributeValue( 
"ejb:util", "generate", false );
   
  -             if( ( generate != null ) && ( generate.equals( "false" ) || 
generate.equals( "no" ) ) )
  -             {
  -                     cat.debug( "Skip util class for " + clazz.qualifiedName() + " 
because of generate=" + generate + " flag." );
  +        if ((generate != null) && (generate.equals("false") || 
generate.equals("no"))) {
  +            log.debug("Skip util class for " + clazz.qualifiedName() + " because of 
generate=" + generate + " flag.");
                        return false;
                }
   
  
  
  
  1.1.2.3   +135 -142  
xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/Attic/LookupUtilTagsHandler.java
  
  Index: LookupUtilTagsHandler.java
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/Attic/LookupUtilTagsHandler.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -w -r1.1.2.2 -r1.1.2.3
  --- LookupUtilTagsHandler.java        27 Apr 2002 13:53:42 -0000      1.1.2.2
  +++ LookupUtilTagsHandler.java        12 May 2002 13:53:30 -0000      1.1.2.3
  @@ -4,67 +4,67 @@
    */
   package xdoclet.modules.ejb.lookup;
   
  +import java.text.MessageFormat;
  +import java.util.Properties;
  +import org.apache.commons.logging.Log;
  +
   import xjavadoc.XClass;
  -import org.apache.log4j.Category;
   import xdoclet.DocletContext;
   import xdoclet.XDocletException;
   import xdoclet.XDocletTagSupport;
  -import xdoclet.util.Log;
  -
  -import xdoclet.modules.ejb.lookup.LookupObjectSubTask;
   import xdoclet.modules.ejb.EjbTagsHandler;
   
  -import java.text.MessageFormat;
  -import java.util.Properties;
  +import xdoclet.modules.ejb.lookup.LookupObjectSubTask;
  +import xdoclet.util.LogUtil;
   
   /**
  - * @xdoclet:taghandler namespace="EjbUtilObj"
  - *
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @created   Oct 15, 2001
  - * @version   $Revision: 1.1.2.2 $
  + * @xdoclet:taghandler   namespace="EjbUtilObj"
  + * @version              $Revision: 1.1.2.3 $
    */
   public class LookupUtilTagsHandler extends EjbTagsHandler
   {
   
        /**
  -      * 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 clazz                 Description of Parameter
         * @return                      The HomeInterface value
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         */
        public static String getUtilClassFor( XClass clazz ) throws XDocletException
        {
  -             Category cat = Log.getCategory( LookupUtilTagsHandler.class, 
"utilClassName" );
  +        Log log = LogUtil.getLog(LookupUtilTagsHandler.class, "utilClassName");
   
                String fileName = clazz.containingPackage().name();
                String util_pattern = null;
   
  -             if( cat.isDebugEnabled() )
  -             {
  -                     cat.debug( " utility object  for " + clazz.qualifiedName() );
  +        if (log.isDebugEnabled()) {
  +            log.debug(" utility object  for " + clazz.qualifiedName());
                }
   
                util_pattern = getUtilClassPattern();
  @@ -72,12 +72,10 @@
                String ejb_name = null;
                String package_pattern = null;
   
  -             if( util_pattern.indexOf( "{0}" ) != -1 )
  -             {
  +        if (util_pattern.indexOf("{0}") != -1) {
                        ejb_name = MessageFormat.format( util_pattern, new 
Object[]{getShortEjbNameFor( clazz )} );
                }
  -             else
  -             {
  +        else {
                        ejb_name = util_pattern;
                }
   
  @@ -97,12 +95,10 @@
        {
                LookupObjectSubTask util_subtask = ( ( LookupObjectSubTask ) 
DocletContext.getInstance().getSubTaskBy( LookupObjectSubTask.SUBTASK_NAME ) );
   
  -             if( util_subtask != null )
  -             {
  +        if (util_subtask != null) {
                        return util_subtask.getUtilClassPattern();
                }
  -             else
  -             {
  +        else {
                        return LookupObjectSubTask.DEFAULT_UTIL_CLASS_PATTERN;
                }
        }
  @@ -111,7 +107,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
  @@ -130,17 +126,14 @@
                         );
   
                //if explicitly specified then use it, otherwise use the kind config 
param of <utilobject/>
  -             if( kind == null )
  -             {
  +        if (kind == null) {
                        kind = ( String ) getDocletContext().getConfigParam( 
LookupObjectSubTask.SUBTASK_NAME + ".kind" );
                }
   
  -             if( kind.equals( "physical" ) )
  -             {
  +        if (kind.equals("physical")) {
                        return "JNDI_NAME";
                }
  -             else
  -             {
  +        else {
                        return "COMP_NAME";
                }
        }
  @@ -150,7 +143,7 @@
         *
         * @param attributes            The attributes of the template tag
         * @return                      Utility class name
  -      * @exception xdoclet.XDocletException  Description of Exception
  +     * @exception XDocletException
         * @doc:tag                     type="content"
         */
        public String utilClass( Properties attributes ) throws XDocletException
  
  
  

_______________________________________________________________

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