public class CloneTransformer<T> extends java.lang.Object implements Transformer<T,T>, java.io.Serializable
Clone is performed using PrototypeFactory.prototypeFactory(input).create()
.
WARNING: This class will throw an
UnsupportedOperationException
when trying to serialize or
de-serialize an instance to prevent potential remote code execution exploits.
In order to re-enable serialization support for CloneTransformer
the following system property can be used (via -Dproperty=true):
org.apache.commons.collections.enableUnsafeSerialization
Modifier and Type | Field and Description |
---|---|
static Transformer |
INSTANCE
Singleton predicate instance
|
private static long |
serialVersionUID
Serial version UID
|
Modifier | Constructor and Description |
---|---|
private |
CloneTransformer()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static <T> Transformer<T,T> |
cloneTransformer()
Factory returning the singleton instance.
|
private void |
readObject(java.io.ObjectInputStream is)
Overrides the default readObject implementation to prevent
de-serialization (see COLLECTIONS-580).
|
private java.lang.Object |
readResolve() |
T |
transform(T input)
Transforms the input to result by cloning it.
|
private void |
writeObject(java.io.ObjectOutputStream os)
Overrides the default writeObject implementation to prevent
serialization (see COLLECTIONS-580).
|
private static final long serialVersionUID
public static final Transformer INSTANCE
public static <T> Transformer<T,T> cloneTransformer()
T
- the type of the objects to be clonedpublic T transform(T input)
transform
in interface Transformer<T,T>
input
- the input object to transformprivate java.lang.Object readResolve()
private void writeObject(java.io.ObjectOutputStream os) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream is) throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundException
java.io.IOException