public class CloneCopyPolicy extends AbstractCopyPolicy
Purpose: Creates a clone through a clone method.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.reflect.Method |
method |
protected java.lang.String |
methodName
Allow for clone method to be specified.
|
protected java.lang.reflect.Method |
workingCopyMethod |
protected java.lang.String |
workingCopyMethodName |
descriptor| Constructor and Description |
|---|
CloneCopyPolicy() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
buildClone(java.lang.Object domainObject,
Session session)
Clone through calling the clone method.
|
boolean |
buildsNewInstance()
Return false as a shallow clone is returned, not a new instance.
|
java.lang.Object |
buildWorkingCopyClone(java.lang.Object domainObject,
Session session)
Clone through the workingCopyClone method, or if not specified the clone method.
|
java.lang.Object |
buildWorkingCopyCloneFromRow(Record row,
ObjectBuildingQuery query)
Create a new instance, unless a workingCopyClone method is specified, then build a new instance and clone it.
|
protected java.lang.reflect.Method |
getMethod()
Return the clone method.
|
java.lang.String |
getMethodName()
Return the clone method name.
|
protected java.lang.reflect.Method |
getWorkingCopyMethod()
Return the workingCopyClone method.
|
java.lang.String |
getWorkingCopyMethodName()
Return the workingCopyClone method name.
|
void |
initialize(Session session)
Validate and build the methods.
|
protected void |
setMethod(java.lang.reflect.Method method)
Set the clone method.
|
void |
setMethodName(java.lang.String methodName)
Set the clone method name.
|
protected void |
setWorkingCopyMethod(java.lang.reflect.Method method)
Set the workingCopyClone method.
|
void |
setWorkingCopyMethodName(java.lang.String methodName)
Set the workingCopyClone method name.
|
java.lang.String |
toString() |
buildWorkingCopyCloneFromRow, clone, getDescriptor, setDescriptorprotected java.lang.String methodName
protected java.lang.String workingCopyMethodName
protected transient java.lang.reflect.Method method
protected transient java.lang.reflect.Method workingCopyMethod
public java.lang.Object buildClone(java.lang.Object domainObject,
Session session)
throws DescriptorException
buildClone in interface CopyPolicybuildClone in class AbstractCopyPolicyDescriptorExceptionpublic java.lang.Object buildWorkingCopyClone(java.lang.Object domainObject,
Session session)
throws DescriptorException
buildWorkingCopyClone in interface CopyPolicybuildWorkingCopyClone in class AbstractCopyPolicyDescriptorExceptionpublic java.lang.Object buildWorkingCopyCloneFromRow(Record row, ObjectBuildingQuery query) throws DescriptorException
buildWorkingCopyCloneFromRow in interface CopyPolicybuildWorkingCopyCloneFromRow in class AbstractCopyPolicyDescriptorExceptionprotected java.lang.reflect.Method getMethod()
public java.lang.String getMethodName()
protected java.lang.reflect.Method getWorkingCopyMethod()
public java.lang.String getWorkingCopyMethodName()
public void initialize(Session session) throws DescriptorException
initialize in interface CopyPolicyinitialize in class AbstractCopyPolicyDescriptorExceptionprotected void setMethod(java.lang.reflect.Method method)
public void setMethodName(java.lang.String methodName)
protected void setWorkingCopyMethod(java.lang.reflect.Method method)
public void setWorkingCopyMethodName(java.lang.String methodName)
public boolean buildsNewInstance()
buildsNewInstance in interface CopyPolicybuildsNewInstance in class AbstractCopyPolicypublic java.lang.String toString()
toString in class java.lang.Object