See: Description
Interface | Description |
---|---|
InstanceFactory<O> |
Class | Description |
---|---|
BeanMonitor |
A monitor of beans.
|
BeanUtil |
Usefull methods around the
PropertyChangeListener . |
Binder<I,O> |
A
binder permits to copy some properties from an object to another
one. |
Binder.BinderModel<S,T> |
Model of a
Binder . |
BinderFactory |
Factory of
Binder . |
BinderFactory.BindelModelEntryMap | |
BinderFactory.BinderModelEntry |
Definition of an binder model entry (source and target types + context name).
|
BinderModelBuilder<S,T> |
Class to create a new
Binder.BinderModel . |
PropertyDiff |
TODO
|
Enum | Description |
---|---|
Binder.CollectionStrategy |
Types of loading of collections.
|
This api permits to some object properties from an object to another one.
A Binder
contains a safe model named
Binder.BinderModel
which knows
all properties that can be copied.
Binder
object from the BinderFactory
like this :
Binder<A, A> binder = BinderFactory.newBinder(A.class);It is also possible to build a more sofisticated binder which will only copy some properties, using the
BinderModelBuilder
.
Binder
api :
To copy all properties from an object to another one :
binder.copy(source, target);To copy just some properties from an object to another one :
binder.copy(source, target, "propertyOne", "propertyTwo");To copy all properties except some :
binder.copyExcluding(source, target, "propertyToExeclude");To obtain some properties from an object, use the following code :
Map<String, Object> properties = binder.obtainProperties(source, "propertyOne", "propertyTwo");
In two words, you have to use the
BinderModelBuilder
object to do this.
then register your binder model into the
BinderFactory
using one of the method
org.nuiton.util.beans.BinderFactory#registerBinderModel(XXX)
.
You can go and look on the unit tests which describe it pretty well :) :
org.nuiton.util.beans.BinderModelBuilderTest
BeanMonitor
classorg.nuiton.util.beans.BeanMonitorTest
Copyright © 2004–2020 CodeLutin. All rights reserved.