|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.beans.BinderModel<S,T>
S - the source typeT - the target typepublic class BinderModel<S,T>
Model of a Binder.
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,Binder<?,?>> |
binders
mapping of extra binders to use to copy properties |
protected java.util.Map<java.lang.String,Binder.CollectionStrategy> |
collectionStrategies
mapping of collection properties strategies |
protected java.util.Map<java.lang.String,java.lang.String> |
propertiesMapping
properties mapping (key are source properties, value are destination properties) |
protected java.util.Map<java.lang.String,java.beans.PropertyDescriptor> |
sourceDescriptors
source type descriptors (key are property names) |
protected java.lang.Class<S> |
sourceType
source type |
protected java.util.Map<java.lang.String,java.beans.PropertyDescriptor> |
targetDescriptors
destination descriptors (key are property names) |
protected java.lang.Class<T> |
targetType
destination type |
| Constructor Summary | |
|---|---|
BinderModel(java.lang.Class<S> sourceType,
java.lang.Class<T> targetType)
|
|
| Method Summary | |
|---|---|
void |
addBinder(java.lang.String propertyName,
Binder<?,?> binder)
|
protected void |
addBinding(java.beans.PropertyDescriptor sourceDescriptor,
java.beans.PropertyDescriptor targetDescriptor)
|
void |
addCollectionStrategy(java.lang.String propertyName,
Binder.CollectionStrategy strategy)
|
protected boolean |
containsBinderProperty(java.lang.String propertyName)
|
protected boolean |
containsCollectionProperty(java.lang.String propertyName)
|
protected boolean |
containsSourceProperty(java.lang.String sourceProperty)
|
protected boolean |
containsTargetProperty(java.lang.String targetProperty)
|
Binder<?,?> |
getBinder(java.lang.String sourceProperty)
|
Binder.CollectionStrategy |
getCollectionStrategy(java.lang.String property)
|
java.lang.Class<?> |
getCollectionType(java.lang.String sourceProperty)
|
protected java.util.Map<java.lang.String,java.lang.String> |
getPropertiesMapping()
|
java.beans.PropertyDescriptor |
getSourceDescriptor(java.lang.String sourceProperty)
Gets the bean descriptor of the source type for the given destination property. |
java.lang.String[] |
getSourceDescriptors()
Gets all registred property names of the binder's source type. |
java.lang.reflect.Method |
getSourceReadMethod(java.lang.String srcProperty)
|
java.lang.Class<S> |
getSourceType()
Gets the type of the binder's source. |
java.lang.reflect.Method |
getSourceWriteMethod(java.lang.String sourceProperty)
|
java.beans.PropertyDescriptor |
getTargetDescriptor(java.lang.String targetProperty)
Gets the bean descriptor of the destination type for the given destination property. |
java.lang.String[] |
getTargetDescriptors()
Gets all registred property names of the binder's destination type. |
java.lang.String |
getTargetProperty(java.lang.String sourceProperty)
Gets the destination property name given the |
java.lang.reflect.Method |
getTargetReadMethod(java.lang.String targetProperty)
|
java.lang.Class<T> |
getTargetType()
Gets the type of the binder's destination |
java.lang.reflect.Method |
getTargetWriteMethod(java.lang.String targetProperty)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.lang.Class<S> sourceType
protected final java.lang.Class<T> targetType
protected final java.util.Map<java.lang.String,java.beans.PropertyDescriptor> sourceDescriptors
protected final java.util.Map<java.lang.String,java.beans.PropertyDescriptor> targetDescriptors
protected final java.util.Map<java.lang.String,java.lang.String> propertiesMapping
protected java.util.Map<java.lang.String,Binder.CollectionStrategy> collectionStrategies
protected java.util.Map<java.lang.String,Binder<?,?>> binders
| Constructor Detail |
|---|
public BinderModel(java.lang.Class<S> sourceType,
java.lang.Class<T> targetType)
| Method Detail |
|---|
public java.lang.Class<S> getSourceType()
public java.lang.Class<T> getTargetType()
public java.lang.String[] getSourceDescriptors()
public Binder.CollectionStrategy getCollectionStrategy(java.lang.String property)
public java.lang.String[] getTargetDescriptors()
public java.lang.String getTargetProperty(java.lang.String sourceProperty)
sourceProperty - the name of the source property to bind
null if propertySrc is unknown in the modelpublic java.beans.PropertyDescriptor getSourceDescriptor(java.lang.String sourceProperty)
sourceProperty - name of the source type property name
null if not found.public java.lang.reflect.Method getSourceReadMethod(java.lang.String srcProperty)
srcProperty - the name of a property of the source object.
public java.lang.reflect.Method getSourceWriteMethod(java.lang.String sourceProperty)
sourceProperty - the name of a property of the source object.
public java.beans.PropertyDescriptor getTargetDescriptor(java.lang.String targetProperty)
targetProperty - name of the destination type property name
null if not found.public java.lang.reflect.Method getTargetReadMethod(java.lang.String targetProperty)
targetProperty - the name of a property of the destination object.
public java.lang.reflect.Method getTargetWriteMethod(java.lang.String targetProperty)
targetProperty - the name of a property of the destination object.
public java.lang.Class<?> getCollectionType(java.lang.String sourceProperty)
public void addCollectionStrategy(java.lang.String propertyName,
Binder.CollectionStrategy strategy)
public void addBinder(java.lang.String propertyName,
Binder<?,?> binder)
protected boolean containsSourceProperty(java.lang.String sourceProperty)
protected boolean containsTargetProperty(java.lang.String targetProperty)
protected boolean containsCollectionProperty(java.lang.String propertyName)
protected boolean containsBinderProperty(java.lang.String propertyName)
protected void addBinding(java.beans.PropertyDescriptor sourceDescriptor,
java.beans.PropertyDescriptor targetDescriptor)
protected java.util.Map<java.lang.String,java.lang.String> getPropertiesMapping()
public Binder<?,?> getBinder(java.lang.String sourceProperty)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||