org.nuiton.util.beans
Class BinderBuilder

java.lang.Object
  extended by org.nuiton.util.beans.BinderBuilder

Deprecated. since 1.5.3, prefer use the BinderModelBuilder instead, will be removed in version 2.0

@Deprecated
public class BinderBuilder
extends Object

A builder of Binder.BinderModel and Binder.

A binder permits to copy some properties from a bean to another one.

Since:
1.1.5
Author:
tchemit
See Also:
Binder.BinderModel, Binder

Field Summary
protected  Binder.BinderModel<?,?> model
          Deprecated. current model used to build the binder
protected  Map<String,PropertyDescriptor> sourceDescriptors
          Deprecated. source properties descriptors
protected  Map<String,PropertyDescriptor> targetDescriptors
          Deprecated. target properties descriptors
 
Constructor Summary
BinderBuilder()
          Deprecated.  
BinderBuilder(Class<?> sourceType, Class<?> targetType, String... properties)
          Deprecated. Creates a binder for the given types and add the given simple properties.
BinderBuilder(Class<?> type, String... properties)
          Deprecated. Creates a mirrored binder for the given type and add the given simple properties.
 
Method Summary
 BinderBuilder addBinder(String propertyName, Binder<?,?> binder)
          Deprecated.  
 BinderBuilder addCollectionStrategy(Binder.CollectionStrategy strategy, String... propertyNames)
          Deprecated.  
 BinderBuilder addProperties(String... sourceAndTargetProperties)
          Deprecated. Add to the binder model some properties.
 BinderBuilder addProperty(String sourceProperty, String targetProperty)
          Deprecated. Add to the binder model some simple properties (says source property name = target property name).
protected  void addProperty0(String sourceProperty, String targetProperty)
          Deprecated.  
 BinderBuilder addSimpleProperties(String... properties)
          Deprecated. Add to the binder model some simple properties (says source property name = target property name).
protected  void checkModelExists()
          Deprecated.  
 Binder<?,?> createBinder()
          Deprecated. 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).
<B extends Binder<?,?>>
B
createBinder(Class<B> binderType)
          Deprecated. 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)
          Deprecated. Creates a new binder model for a mirrored binder (source type = target type).
 BinderBuilder createBinderModel(Class<?> sourceType, Class<?> targetType)
          Deprecated. Creates a new binder model.
protected  Binder.BinderModel<?,?> getModel()
          Deprecated.  
protected static void loadDescriptors(Class<?> type, Map<String,PropertyDescriptor> descriptors)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected Binder.BinderModel<?,?> model
Deprecated. 
current model used to build the binder


sourceDescriptors

protected Map<String,PropertyDescriptor> sourceDescriptors
Deprecated. 
source properties descriptors


targetDescriptors

protected Map<String,PropertyDescriptor> targetDescriptors
Deprecated. 
target properties descriptors

Constructor Detail

BinderBuilder

public BinderBuilder()
Deprecated. 

BinderBuilder

public BinderBuilder(Class<?> type,
                     String... properties)
Deprecated. 
Creates a mirrored binder for the given type and add the given simple properties.

Parameters:
type - the type of mirrored binder
properties - simple properties to add

BinderBuilder

public BinderBuilder(Class<?> sourceType,
                     Class<?> targetType,
                     String... properties)
Deprecated. 
Creates a binder for the given types and add the given simple properties.

Parameters:
sourceType - type of the source of the binder
targetType - type of the target of the binder
properties - simple properties to add
Method Detail

createBinderModel

public BinderBuilder createBinderModel(Class<?> type)
                                throws IllegalStateException,
                                       NullPointerException
Deprecated. 
Creates a new binder model for a mirrored binder (source type = target type).

Note: If a previous model was created, but not released via the method createBinder(Class), the method will failed.

Parameters:
type - the type of source and target
Returns:
the instance of the builder
Throws:
IllegalStateException - if a previous builder model was created without been released
NullPointerException - if a parameter is null

createBinderModel

public BinderBuilder createBinderModel(Class<?> sourceType,
                                       Class<?> targetType)
                                throws IllegalStateException,
                                       NullPointerException
Deprecated. 
Creates a new binder model.

Note: If a previous model was created, but not released via the method createBinder(Class), the method will failed.

Parameters:
sourceType - the type of the source
targetType - the type of the target
Returns:
the instance of the builder
Throws:
IllegalStateException - if a previous builder model was created without been released
NullPointerException - if a parameter is null

createBinder

public Binder<?,?> createBinder()
                         throws NullPointerException,
                                IllegalStateException
Deprecated. 
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).

Note: If no model is present, the method will fail.

Returns:
the instance of the new buinder.
Throws:
IllegalStateException - if no model was previously created.
NullPointerException - if the parameter is null

createBinder

public <B extends Binder<?,?>> B createBinder(Class<B> binderType)
                                   throws NullPointerException,
                                          IllegalStateException
Deprecated. 
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).

Note: If no model is present, the method will fail.

Type Parameters:
B - the type of binder to instanciate
Parameters:
binderType - the type of binder to instanciate
Returns:
the instance of the new buinder.
Throws:
IllegalStateException - if no model was previously created.
NullPointerException - if the parameter is null

addSimpleProperties

public BinderBuilder addSimpleProperties(String... properties)
                                  throws IllegalStateException,
                                         NullPointerException
Deprecated. 
Add to the binder model some simple properties (says source property name = target property name).

Note: If no model is present, the method will fail.

Parameters:
properties - the name of mirrored property
Returns:
the instance of the builder
Throws:
IllegalStateException - if no model was previously created
NullPointerException - if a property is null

addProperty

public BinderBuilder addProperty(String sourceProperty,
                                 String targetProperty)
                          throws IllegalStateException,
                                 NullPointerException
Deprecated. 
Add to the binder model some simple properties (says source property name = target property name).

Note: If no model is present, the method will fail.

Parameters:
sourceProperty - the name of the source property to bind
targetProperty - the name of the target property to bind
Returns:
the instance of the builder
Throws:
IllegalStateException - if no model was previously created
NullPointerException - if a parameter is null

addProperties

public BinderBuilder addProperties(String... sourceAndTargetProperties)
                            throws IllegalStateException,
                                   IllegalArgumentException,
                                   NullPointerException
Deprecated. 
Add to the binder model some properties.

Parameter 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.

Parameters:
sourceAndTargetProperties - the couple of (sourceProperty - targetProperty) to bind
Returns:
the instance of the builder
Throws:
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

addCollectionStrategy

public BinderBuilder addCollectionStrategy(Binder.CollectionStrategy strategy,
                                           String... propertyNames)
Deprecated. 

addBinder

public BinderBuilder addBinder(String propertyName,
                               Binder<?,?> binder)
Deprecated. 

addProperty0

protected void addProperty0(String sourceProperty,
                            String targetProperty)
Deprecated. 

checkModelExists

protected void checkModelExists()
                         throws IllegalStateException
Deprecated. 
Throws:
IllegalStateException

getModel

protected Binder.BinderModel<?,?> getModel()
Deprecated. 

loadDescriptors

protected static void loadDescriptors(Class<?> type,
                                      Map<String,PropertyDescriptor> descriptors)
Deprecated. 


Copyright © 2004-2010 CodeLutin. All Rights Reserved.