public interface CloneDriver extends CloneImplementor
Cloner
*Modifier and Type | Method and Description |
---|---|
CloneImplementor |
getAnnotationImplementor(Class<?> clazz)
Retrieves the registered implementor for the given class
|
CloneImplementor |
getBuiltInImplementor(Class<?> clazz)
Gets the built in implementor for the given class
|
MethodHandle |
getCloneMethod(Class<?> clazz)
Returns the clone() method for the indicated class
|
Set<Class<?>> |
getImmutableClasses()
A list of classes that should be treated as immutable.
|
CloneImplementor |
getImplementor(Class<?> clazz)
Retrieves the registered implementor for the given class
|
Set<Class<?>> |
getNonCloneableClasses()
A list of classes that should not be cloned.
|
boolean |
isCloneImmutable()
If false, indicates that classes known to be immutable should be not cloned.
|
boolean |
isCloneSyntheticFields()
Indicates whether synthetic fields should be cloned
|
boolean |
isCloneTransientAnnotatedFields()
If false, indicates that fields annotated by the
Transient annotation should not be
cloned, instead being replaced with null. |
boolean |
isCloneTransientFields()
If false, indicates that fields modified by the transient keyword should not be cloned,
instead being replaced with null.
|
boolean |
isImmutableInstance(Object instance)
Indicates whether the given object instance should be treated as immutable
|
boolean |
isTrackReferences()
Indicates whether to track references
|
boolean |
isTrackReferencesForFlatClasses()
Indicates whether to also track references for flat classes when tracking references.
|
boolean |
isUseCloneable()
If true, then any class that implements
Cloneable will be cloned using the
Object.clone() method. |
boolean |
isUseCloneImplementors()
Indicates whether custom clone implementors are enabled
|
void |
putAnnotationImplementor(Class<?> clazz,
CloneImplementor implementor)
Put the registered implementor for the given class
|
void |
putCloneMethod(Class<?> clazz,
MethodHandle handle)
Put the clone() method for the indicated class
|
void |
putImmutableInstance(Object instance)
Stores an object instance to be treated as immutable
|
canClone, clone, newInstance
CloneImplementor getBuiltInImplementor(Class<?> clazz)
clazz
- The classCloneImplementor getImplementor(Class<?> clazz)
clazz
- The classCloneImplementor getAnnotationImplementor(Class<?> clazz)
clazz
- The classvoid putAnnotationImplementor(Class<?> clazz, CloneImplementor implementor)
clazz
- The classimplementor
- Implementor to registerboolean isUseCloneable()
Cloneable
will be cloned using the
Object.clone()
method.MethodHandle getCloneMethod(Class<?> clazz)
clazz
- The class to obtain the method forvoid putCloneMethod(Class<?> clazz, MethodHandle handle)
clazz
- The class to obtain the method forhandle
- The related MethodHandleboolean isCloneTransientFields()
boolean isCloneTransientAnnotatedFields()
Transient
annotation should not be
cloned, instead being replaced with null.boolean isCloneImmutable()
Set<Class<?>> getImmutableClasses()
Set<Class<?>> getNonCloneableClasses()
boolean isUseCloneImplementors()
boolean isCloneSyntheticFields()
boolean isImmutableInstance(Object instance)
instance
- The instance to check for whether it is registered as immutablevoid putImmutableInstance(Object instance)
instance
- Object to be considered immutableboolean isTrackReferences()
boolean isTrackReferencesForFlatClasses()
Copyright © 2010–2018 Jadira Systems. All rights reserved.