You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2002/06/29 14:48:18 UTC
cvs commit: jakarta-commons-sandbox/pattern/src/java/org/apache/commons/pattern/factory FactoryUtils.java
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>