public class CloneCopyPolicy extends AbstractCopyPolicy
Purpose: Creates a clone through a clone method.
Modifier and Type | Field and Description |
---|---|
protected Method |
method |
protected String |
methodName
Allow for clone method to be specified.
|
protected Method |
workingCopyMethod |
protected String |
workingCopyMethodName |
descriptor
Constructor and Description |
---|
CloneCopyPolicy() |
Modifier and Type | Method and Description |
---|---|
Object |
buildClone(Object domainObject,
Session session)
Clone through calling the clone method.
|
boolean |
buildsNewInstance()
Return false as a shallow clone is returned, not a new instance.
|
Object |
buildWorkingCopyClone(Object domainObject,
Session session)
Clone through the workingCopyClone method, or if not specified the clone method.
|
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 Method |
getMethod()
Return the clone method.
|
String |
getMethodName()
Return the clone method name.
|
protected Method |
getWorkingCopyMethod()
Return the workingCopyClone method.
|
String |
getWorkingCopyMethodName()
Return the workingCopyClone method name.
|
void |
initialize(Session session)
Validate and build the methods.
|
protected void |
setMethod(Method method)
Set the clone method.
|
void |
setMethodName(String methodName)
Set the clone method name.
|
protected void |
setWorkingCopyMethod(Method method)
Set the workingCopyClone method.
|
void |
setWorkingCopyMethodName(String methodName)
Set the workingCopyClone method name.
|
String |
toString() |
buildWorkingCopyCloneFromRow, clone, getDescriptor, setDescriptor
protected String methodName
protected String workingCopyMethodName
protected transient Method method
protected transient Method workingCopyMethod
public Object buildClone(Object domainObject, Session session) throws DescriptorException
buildClone
in interface CopyPolicy
buildClone
in class AbstractCopyPolicy
DescriptorException
public Object buildWorkingCopyClone(Object domainObject, Session session) throws DescriptorException
buildWorkingCopyClone
in interface CopyPolicy
buildWorkingCopyClone
in class AbstractCopyPolicy
DescriptorException
public Object buildWorkingCopyCloneFromRow(Record row, ObjectBuildingQuery query) throws DescriptorException
buildWorkingCopyCloneFromRow
in interface CopyPolicy
buildWorkingCopyCloneFromRow
in class AbstractCopyPolicy
DescriptorException
protected Method getMethod()
public String getMethodName()
protected Method getWorkingCopyMethod()
public String getWorkingCopyMethodName()
public void initialize(Session session) throws DescriptorException
initialize
in interface CopyPolicy
initialize
in class AbstractCopyPolicy
DescriptorException
protected void setMethod(Method method)
public void setMethodName(String methodName)
protected void setWorkingCopyMethod(Method method)
public void setWorkingCopyMethodName(String methodName)
public boolean buildsNewInstance()
buildsNewInstance
in interface CopyPolicy
buildsNewInstance
in class AbstractCopyPolicy
Copyright © 2022. All rights reserved.