⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.functors

Class PrototypeFactory

java.lang.Object
|
+--org.apache.commons.collections.functors.PrototypeFactory


public class PrototypeFactory
extends java.lang.Object

Factory implementation that creates a new instance each time based on a prototype.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

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

Parameters:
prototype - the object to clone each time in the factory
Returns:
the prototype factory
Throws:
- if the prototype is null
- if the prototype cannot be cloned