commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons-sandbox/pattern/src/java/org/apache/commons/pattern/factory FactoryUtils.java
Date Sat, 29 Jun 2002 12:48:18 GMT
scolebourne    2002/06/29 05:48:18

  Modified:    pattern/src/java/org/apache/commons/pattern/factory
                        FactoryUtils.java
  Log:
  Add Javadoc
  Fix to add private constructor
  Make Null factory public constant
  Tidy coding style
  
  Revision  Changes    Path
  1.4       +14 -6     jakarta-commons-sandbox/pattern/src/java/org/apache/commons/pattern/factory/FactoryUtils.java
  
  Index: FactoryUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/pattern/src/java/org/apache/commons/pattern/factory/FactoryUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FactoryUtils.java	27 Jun 2002 21:57:34 -0000	1.3
  +++ FactoryUtils.java	29 Jun 2002 12:48:18 -0000	1.4
  @@ -69,13 +69,24 @@
    * <li>PrototypeFactory - A factory that clones a specified object
    * <li>ReflectionFactory - A factory that creates objects using reflection
    * </ul>
  + * All the supplied factories are Serializable.
    *
    * @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
    * @version $Id$
    */
   public class FactoryUtils {
       
  -    private static final Factory NULL_FACTORY = new ConstantFactory(null);
  +    /**
  +     * A factory that always returns null
  +     */
  +    public static final Factory NULL_FACTORY = new ConstantFactory(null);
  +
  +    /**
  +     * Restructive constructor
  +     */
  +    private FactoryUtils() {
  +        super();
  +    }
   
       /** 
        * Creates a Factory that will return null each time the factory is used.
  @@ -191,7 +202,6 @@
           public Object create() {
               return iConstant;
           }
  -        
       }
       
       
  @@ -202,7 +212,6 @@
        * PrototypeCloneFactory creates objects by copying a prototype using the clone method.
        */
       private static class PrototypeCloneFactory implements Factory, Serializable {
  -        
           private final Object iPrototype;
           private transient Method iCloneMethod;
           
  @@ -249,7 +258,6 @@
                   throw new FactoryException("ReflectionFactory: Clone method threw an exception",
ex);
               }
           }
  -        
       }
       
       
  @@ -285,7 +293,6 @@
                   throw new FactoryException("PrototypeSerializationFactory: Unable to clone
by serialization", ex);
               }
           }
  -        
       }
       
       
  @@ -363,4 +370,5 @@
               }
           }
       }
  -}
  \ No newline at end of file
  +    
  +}
  
  
  

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


Mime
View raw message