public class PrototypeFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Factory |
getInstance(java.lang.Object prototype)
Factory method that performs validation.
|
public static Factory getInstance(java.lang.Object prototype)
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):
WARNING: from v3.2.2 onwards this method will return a Factory
that will throw an UnsupportedOperationException
when trying to serialize
or de-serialize it to prevent potential remote code execution exploits.
In order to re-enable serialization support the following system property can be used (via -Dproperty=true):
org.apache.commons.collections.enableUnsafeSerialization
prototype
- the object to clone each time in the factoryprototype
factoryjava.lang.IllegalArgumentException
- if the prototype is nulljava.lang.IllegalArgumentException
- if the prototype cannot be cloned"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"