org.clazzes.util.reflect
Class ClonerFactory

java.lang.Object
  extended by org.clazzes.util.reflect.ClonerFactory
Direct Known Subclasses:
ClonerFactoryImpl

public abstract class ClonerFactory
extends java.lang.Object

A factory for cloners.

Author:
wglas

Constructor Summary
ClonerFactory()
           
 
Method Summary
abstract
<T> Cloner<T>
newCloner(java.lang.Class<T> clazz)
          Return a cloner for a given POJO class.
static ClonerFactory newInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClonerFactory

public ClonerFactory()
Method Detail

newInstance

public static ClonerFactory newInstance()
Returns:
The first cloner factory implementation, which is registered under the resource path META-INF/org.clazzes.util.reflect.ClonerFactory.
See Also:
ServiceRegistry.lookupProviders(Class)

newCloner

public abstract <T> Cloner<T> newCloner(java.lang.Class<T> clazz)
Return a cloner for a given POJO class. Please note, that if your class supports multiple subclasses and the cloner returned for your class should return appropriate subclass instances, it is strongly recommended, that your class implements the Cloneable interface.

Type Parameters:
T -
Parameters:
clazz - The POJO class to clone.
Returns:
A cloner, which returns clones of the given class.


Copyright © 2010. All Rights Reserved.