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/type DefaultTypeFactory.java
Date Thu, 07 Feb 2002 10:35:16 GMT
donaldp     02/02/07 02:35:16

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type
                        DefaultTypeFactory.java
  Log:
  Made it possible to subclass the TypeFactory and use different strategies for getting ClassLoader
  
  Revision  Changes    Path
  1.8       +16 -2     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type/DefaultTypeFactory.java
  
  Index: DefaultTypeFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/type/DefaultTypeFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultTypeFactory.java	7 Feb 2002 08:57:44 -0000	1.7
  +++ DefaultTypeFactory.java	7 Feb 2002 10:35:16 -0000	1.8
  @@ -15,7 +15,7 @@
    * Create a type instance based on name.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version CVS $Revision: 1.7 $ $Date: 2002/02/07 08:57:44 $
  + * @version CVS $Revision: 1.8 $ $Date: 2002/02/07 10:35:16 $
    */
   public class DefaultTypeFactory
       implements TypeFactory
  @@ -29,6 +29,10 @@
       ///The parent classLoader (if any)
       private ClassLoader m_classLoader;
   
  +    /**
  +     * Construct a factory that uses specified ClassLoader to load
  +     * types from.
  +     */
       public DefaultTypeFactory( final ClassLoader classLoader )
       {
           if( null == classLoader )
  @@ -39,6 +43,16 @@
           m_classLoader = classLoader;
       }
   
  +    /**
  +     * No arg constructor used by subclasses who wish to overide getClassLoader().
  +     */
  +    protected DefaultTypeFactory()
  +    {
  +    }
  +
  +    /**
  +     * Map a name to the fully qualified name of the Class that implements type.
  +     */
       public void addNameClassMapping( final String name, final String className )
       {
           m_classNames.put( name, className );
  @@ -81,7 +95,7 @@
           return className;
       }
   
  -    private ClassLoader getClassLoader()
  +    protected ClassLoader getClassLoader()
       {
           return m_classLoader;
       }
  
  
  

--
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