public class BeanCopy extends BeanVisitor
BeanVisitor| Modifier and Type | Field and Description |
|---|---|
protected boolean |
declaredTarget |
protected java.lang.Object |
destination |
blacklist, declared, ignoreNullValues, includeFields, rules, source| Constructor and Description |
|---|
BeanCopy(java.lang.Object source,
java.lang.Object destination) |
| Modifier and Type | Method and Description |
|---|---|
static BeanCopy |
beans(java.lang.Object source,
java.lang.Object destination)
Static factory.
|
void |
copy()
Performs the copying.
|
BeanCopy |
declared(boolean declared)
Defines if all properties should be copied (when set to
true)
or only public (when set to false, default). |
BeanCopy |
declared(boolean declaredSource,
boolean declaredTarget)
Fine-tuning of the declared behaviour.
|
BeanCopy |
exclude(java.lang.String... excludes)
Defines excluded property names.
|
BeanCopy |
exclude(java.lang.String exclude)
Exclude a property.
|
BeanCopy |
excludeAll()
Excludes all properties, i.e. enables blacklist mode.
|
BeanCopy |
ignoreNulls(boolean ignoreNulls)
Defines if
null values should be ignored. |
BeanCopy |
include(java.lang.String... includes)
Defines included property names.
|
BeanCopy |
include(java.lang.String include)
Include a property.
|
BeanCopy |
includeAs(java.lang.Class template)
Defines included property names as public properties
of given template class.
|
BeanCopy |
includeFields(boolean includeFields)
Defines if fields without getters should be copied too.
|
protected boolean |
visitProperty(java.lang.String name,
java.lang.Object value)
Copies single property to the destination.
|
accept, getAllBeanPropertyNames, resolveProperties, visitprotected java.lang.Object destination
protected boolean declaredTarget
public static BeanCopy beans(java.lang.Object source, java.lang.Object destination)
public BeanCopy excludeAll()
public BeanCopy exclude(java.lang.String... excludes)
public BeanCopy exclude(java.lang.String exclude)
public BeanCopy include(java.lang.String... includes)
public BeanCopy include(java.lang.String include)
public BeanCopy includeAs(java.lang.Class template)
public BeanCopy ignoreNulls(boolean ignoreNulls)
null values should be ignored.public BeanCopy declared(boolean declared)
true)
or only public (when set to false, default).public BeanCopy declared(boolean declaredSource, boolean declaredTarget)
public BeanCopy includeFields(boolean includeFields)
public void copy()
protected boolean visitProperty(java.lang.String name,
java.lang.Object value)
visitProperty in class BeanVisitorCopyright © 2003-2013 Jodd Team