User: vharcq  
  Date: 02/02/22 16:22:40

  Modified:    core/src/xdoclet/ejb EntityCmpSubTask.java
  Log:
  Add "cmpspec" attr to <entitycmp/> subtask.  This permit for beans to not be aware 
of wich cmp implementation will be used for their implementation.  And so facilitate 
migration cmp1 to cmp2
  
  Revision  Changes    Path
  1.24      +34 -1     xdoclet/core/src/xdoclet/ejb/EntityCmpSubTask.java
  
  Index: EntityCmpSubTask.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/EntityCmpSubTask.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -w -r1.23 -r1.24
  --- EntityCmpSubTask.java     22 Feb 2002 16:28:20 -0000      1.23
  +++ EntityCmpSubTask.java     23 Feb 2002 00:22:40 -0000      1.24
  @@ -19,7 +19,7 @@
   /**
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @created   Oct 15, 2001
  - * @version   $Revision: 1.23 $
  + * @version   $Revision: 1.24 $
    */
   public class EntityCmpSubTask extends AbstractEjbCodeGeneratorSubTask
   {
  @@ -36,6 +36,7 @@
         * @see   #getEntityCmpClassPattern()
         */
        protected String   entityCmpClassPattern;
  +     private String     cmpspec = CmpSpecVersion.CMP_2_0;
   
        public EntityCmpSubTask()
        {
  @@ -51,6 +52,11 @@
                return SUBTASK_NAME;
        }
   
  +     public String getCmpSpec()
  +     {
  +             return cmpspec;
  +     }
  +
        /**
         * Returns the configuration parameter for specifying the concrete CMP entity
         * bean class name pattern. By default the value is used for deciding the
  @@ -69,6 +75,11 @@
                        return DEFAULT_ENTITYCMP_CLASS_PATTERN;
        }
   
  +     public void setCmpSpec( CmpSpecVersion cmpspec )
  +     {
  +             this.cmpspec = cmpspec.getValue();
  +     }
  +
        public void setPattern( String new_pattern )
        {
                entityCmpClassPattern = new_pattern;
  @@ -138,6 +149,28 @@
        {
                System.out.println( Translator.getString( "xdoclet.ejb.Messages", 
"generating_cmp_for",
                        new String[]{getCurrentClass().qualifiedName()} ) );
  +     }
  +
  +     /**
  +      * @author    Vincent Harcq ([EMAIL PROTECTED])
  +      * @created   February 23, 2002
  +      */
  +     public static class CmpSpecVersion extends 
org.apache.tools.ant.types.EnumeratedAttribute
  +     {
  +             public final static String CMP_1_1 = "1.x";
  +             public final static String CMP_2_0 = "2.x";
  +             public final static java.lang.String getVersions()
  +             {
  +                     return CMP_1_1 + "," + CMP_2_0;
  +             }
  +
  +             public java.lang.String[] getValues()
  +             {
  +                     return ( new java.lang.String[]{
  +                             CMP_1_1, CMP_2_0
  +                             } );
  +             }
  +
        }
   
   }
  
  
  

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

Reply via email to