org.apache.commons.collections.functors

Class PrototypeFactory


public class PrototypeFactory
extends Object

Factory implementation that creates a new instance each time based on a prototype.

Version:
$Revision: 1.7 $ $Date: 2004/05/16 11:47:38 $

Author:
Stephen Colebourne

Since:
Commons Collections 3.0

Method Summary

static Factory
getInstance(Object prototype)
Factory method that performs validation.

Method Details

getInstance

public static Factory getInstance(Object prototype)
Factory method that performs validation.

Creates a Factory that will return a clone of the same prototype object each time the factory is used. The prototype will be cloned using one of these techniques (in order):

  • public clone method
  • public copy constructor
  • serialization clone

Parameters:
prototype - the object to clone each time in the factory

Returns:
the prototype factory


Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.