ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer ConverterDefinition.java TypeDefinition.java GeneralTypeDefinition.java
Date Sun, 03 Feb 2002 03:38:58 GMT
donaldp     02/02/02 19:38:58

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer
                        ConverterDefinition.java TypeDefinition.java
  Removed:     proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer
                        GeneralTypeDefinition.java
  Log:
  Merged GeneralTypeDefinition and TypeDefinition into one class.
  
  Made all the TypeDefinition and ConverterTypeDefinition immutable objects as that eases
evolution. See mailing list for more explanation
  
  Revision  Changes    Path
  1.2       +8 -31     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/ConverterDefinition.java
  
  Index: ConverterDefinition.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/ConverterDefinition.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConverterDefinition.java	2 Feb 2002 12:51:59 -0000	1.1
  +++ ConverterDefinition.java	3 Feb 2002 03:38:57 -0000	1.2
  @@ -15,23 +15,16 @@
   public class ConverterDefinition
       extends TypeDefinition
   {
  -    private String m_sourceType;
  -    private String m_destinationType;
  +    private final String m_sourceType;
  +    private final String m_destinationType;
   
  -    /**
  -     * Returns the type's role.
  -     */
  -    public String getRoleShorthand()
  +    public ConverterDefinition( final String className,
  +                                final String sourceType,
  +                                final String destinationType )
       {
  -        return "converter";
  -    }
  -
  -    /**
  -     * Returns the type's name.
  -     */
  -    public String getName()
  -    {
  -        return getClassname();
  +        super( className, "converter", className );
  +        m_sourceType = sourceType;
  +        m_destinationType = destinationType;
       }
   
       /**
  @@ -43,26 +36,10 @@
       }
   
       /**
  -     * Sets the converter's source type.
  -     */
  -    public void setSourceType( final String sourceType )
  -    {
  -        m_sourceType = sourceType;
  -    }
  -
  -    /**
        * Returns the converter's destination type.
        */
       public String getDestinationType()
       {
           return m_destinationType;
  -    }
  -
  -    /**
  -     * Sets the converter's destination type.
  -     */
  -    public void setDestinationType( final String destinationType )
  -    {
  -        m_destinationType = destinationType;
       }
   }
  
  
  
  1.2       +24 -16    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/TypeDefinition.java
  
  Index: TypeDefinition.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/TypeDefinition.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TypeDefinition.java	2 Feb 2002 12:51:59 -0000	1.1
  +++ TypeDefinition.java	3 Feb 2002 03:38:57 -0000	1.2
  @@ -8,38 +8,46 @@
   package org.apache.myrmidon.interfaces.deployer;
   
   /**
  - * A basic type definition.  This class is used to build a type definition,
  - * from a typelib descriptor, or via introspection.
  + * A general-purpose type definition.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
    */
  -public abstract class TypeDefinition
  +public class TypeDefinition
   {
  -    private String m_className;
  +    private final String m_name;
  +    private final String m_role;
  +    private final String m_classname;
   
  -    /**
  -     * Returns the type's name.
  -     */
  -    public abstract String getName();
  +    public TypeDefinition( final String name,
  +                           final String roleShorthand,
  +                           final String className )
  +    {
  +        m_name = name;
  +        m_role = roleShorthand;
  +        m_classname = className;
  +    }
   
       /**
  -     * Returns the type's role.
  +     * Returns the type's implementation class name.
        */
  -    public abstract String getRoleShorthand();
  +    public final String getClassname()
  +    {
  +        return m_classname;
  +    }
   
       /**
  -     * Returns the type's implementation class name.
  +     * Returns the type's role.
        */
  -    public String getClassname()
  +    public final String getRole()
       {
  -        return m_className;
  +        return m_role;
       }
   
       /**
  -     * Sets the type's implementation class name.
  +     * Returns the type's name.
        */
  -    public void setClassname( final String className )
  +    public String getName()
       {
  -        m_className = className;
  +        return m_name;
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message