|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.beans.BinderBuilder
public class BinderBuilder
A builder of BinderModel and Binder.
binder permits to copy some properties from a bean to another one.
BinderModel,
Binder| Field Summary | |
|---|---|
protected BinderModel<?,?> |
model
current model used to build the binder |
protected Map<String,PropertyDescriptor> |
sourceDescriptors
source properties descriptors |
protected Map<String,PropertyDescriptor> |
targetDescriptors
target properties descriptors |
| Constructor Summary | |
|---|---|
BinderBuilder()
|
|
BinderBuilder(Class<?> sourceType,
Class<?> targetType,
String... properties)
Creates a binder for the given types and add the given simple properties. |
|
BinderBuilder(Class<?> type,
String... properties)
Creates a mirrored binder for the given type and add the given
simple properties. |
|
| Method Summary | ||
|---|---|---|
BinderBuilder |
addProperties(String... sourceAndTargetProperties)
Add to the binder model some properties. |
|
BinderBuilder |
addProperty(String sourceProperty,
String targetProperty)
Add to the binder model some simple properties (says source property name = target property name). |
|
protected void |
addProperty0(String sourceProperty,
String targetProperty)
|
|
BinderBuilder |
addSimpleProperties(String... properties)
Add to the binder model some simple properties (says source property name = target property name). |
|
protected void |
checkModelExists()
|
|
Binder<?,?> |
createBinder()
Creates a new binder given using the Binder type of binder
from the internal binder model
previously created via the method createBinderModel<XXX> and
then filled with methods addXXX(XXX). |
|
|
createBinder(Class<B> binderType)
Creates a new binder given his type from the internal binder model previously created via the method createBinderModel<XXX> and
then filled with methods addXXX(XXX). |
|
BinderBuilder |
createBinderModel(Class<?> type)
Creates a new binder model for a mirrored binder (source type = target type). |
|
BinderBuilder |
createBinderModel(Class<?> sourceType,
Class<?> targetType)
Creates a new binder model. |
|
protected BinderModel<?,?> |
getModel()
|
|
protected static void |
loadDescriptors(Class<?> type,
Map<String,PropertyDescriptor> descriptors)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected BinderModel<?,?> model
protected Map<String,PropertyDescriptor> sourceDescriptors
protected Map<String,PropertyDescriptor> targetDescriptors
| Constructor Detail |
|---|
public BinderBuilder()
public BinderBuilder(Class<?> type,
String... properties)
type and add the given
simple properties.
type - the type of mirrored binderproperties - simple properties to add
public BinderBuilder(Class<?> sourceType,
Class<?> targetType,
String... properties)
sourceType - type of the source of the bindertargetType - type of the target of the binderproperties - simple properties to add| Method Detail |
|---|
public BinderBuilder createBinderModel(Class<?> type)
throws IllegalStateException,
NullPointerException
createBinder(Class), the method will failed.
type - the type of source and target
IllegalStateException - if a previous builder model was created
without been released
NullPointerException - if a parameter is null
public BinderBuilder createBinderModel(Class<?> sourceType,
Class<?> targetType)
throws IllegalStateException,
NullPointerException
createBinder(Class), the method will failed.
sourceType - the type of the sourcetargetType - the type of the target
IllegalStateException - if a previous builder model was created
without been released
NullPointerException - if a parameter is null
public Binder<?,?> createBinder()
throws NullPointerException,
IllegalStateException
Binder type of binder
from the internal binder model
previously created via the method createBinderModel<XXX> and
then filled with methods addXXX(XXX).
Note: If no model is present, the method will fail.
IllegalStateException - if no model was previously created.
NullPointerException - if the parameter is null
public <B extends Binder<?,?>> B createBinder(Class<B> binderType)
throws NullPointerException,
IllegalStateException
createBinderModel<XXX> and
then filled with methods addXXX(XXX).
Note: If no model is present, the method will fail.
B - the type of binder to instanciatebinderType - the type of binder to instanciate
IllegalStateException - if no model was previously created.
NullPointerException - if the parameter is null
public BinderBuilder addSimpleProperties(String... properties)
throws IllegalStateException,
NullPointerException
properties - the name of mirrored property
IllegalStateException - if no model was previously created
NullPointerException - if a property is null
public BinderBuilder addProperty(String sourceProperty,
String targetProperty)
throws IllegalStateException,
NullPointerException
sourceProperty - the name of the source property to bindtargetProperty - the name of the target property to bind
IllegalStateException - if no model was previously created
NullPointerException - if a parameter is null
public BinderBuilder addProperties(String... sourceAndTargetProperties)
throws IllegalStateException,
IllegalArgumentException,
NullPointerException
sourceAndTargetProperties must be a array of couple
of sourceProperty, targetProperty.
Example :
builder.addProperties("name","name2","text","text");
Note: If no model is present, the method will fail.
sourceAndTargetProperties - the couple of (sourceProperty -
targetProperty) to bind
IllegalStateException - if no model was previously created
IllegalArgumentException - if there is not the same number of
source and target properties
NullPointerException - if a parameter is null
protected void addProperty0(String sourceProperty,
String targetProperty)
protected void checkModelExists()
throws IllegalStateException
IllegalStateExceptionprotected BinderModel<?,?> getModel()
protected static void loadDescriptors(Class<?> type,
Map<String,PropertyDescriptor> descriptors)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||