org.viewaframework.binding.core
Interface BeanAdapter<T>

Type Parameters:
T -
All Superinterfaces:
Adapter<T>, Observable
All Known Implementing Classes:
BasicBeanAdapter, LazyBeanAdapter

public interface BeanAdapter<T>
extends Adapter<T>

Adapter for encapsulate accessing JavaBeans

Author:
Mario Garcia

Method Summary
 Class<?> getPropertyClass(String propertyName)
          Returns the class of the property name passed as parameter
<U> U
getValue(Class<U> clazz, String propertyName)
          Returns the value of the desired property with the type passed as parameter
<U> List<U>
getValueList(Class<U> clazz, String propertyName)
          Returs the property value as a List
<K,V> Map<K,V>
getValueMap(Class<K> clazzKey, Class<V> clazzValue, String propertyName)
          Returns the value as a java.util.Map
<U> Set<U>
getValueSet(Class<U> clazz, String property)
          Returns the value as a java.util.Set
 String getValueString(String propertyName)
          Returns the string representation of the property
<V> BasicBeanAdapter<T>
setValue(Class<V> clazz, String propertyName, V value)
          Sets the property value
 BeanAdapter<T> setValue(String propertyName, Object value)
          Sets the property value
 
Methods inherited from interface org.viewaframework.binding.core.Adapter
getName, getSource, isSync, setName, setSource, sync
 
Methods inherited from interface org.viewaframework.binding.core.Observable
addPropertyChangeListener, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener
 

Method Detail

getPropertyClass

Class<?> getPropertyClass(String propertyName)
Returns the class of the property name passed as parameter

Parameters:
propertyName - The name of the property
Returns:
the type of the property

getValue

<U> U getValue(Class<U> clazz,
               String propertyName)
Returns the value of the desired property with the type passed as parameter

Type Parameters:
U - returned object
Parameters:
clazz - the desired type
propertyName - the property name
Returns:
the property value
Throws:
Exception

getValueList

<U> List<U> getValueList(Class<U> clazz,
                         String propertyName)
Returs the property value as a List

Type Parameters:
U -
Parameters:
clazz -
propertyName -
Returns:
Throws:
Exception

getValueMap

<K,V> Map<K,V> getValueMap(Class<K> clazzKey,
                           Class<V> clazzValue,
                           String propertyName)
Returns the value as a java.util.Map

Type Parameters:
K -
V -
Parameters:
clazzKey -
clazzValue -
propertyName -
Returns:
Throws:
Exception

getValueSet

<U> Set<U> getValueSet(Class<U> clazz,
                       String property)
Returns the value as a java.util.Set

Type Parameters:
U -
Parameters:
clazz -
property -
Returns:
Throws:
Exception

getValueString

String getValueString(String propertyName)
Returns the string representation of the property

Parameters:
propertyName -
Returns:
Throws:
Exception

setValue

<V> BasicBeanAdapter<T> setValue(Class<V> clazz,
                                 String propertyName,
                                 V value)
Sets the property value

Type Parameters:
V -
Parameters:
clazz -
propertyName -
value -
Returns:

setValue

BeanAdapter<T> setValue(String propertyName,
                        Object value)
Sets the property value

Parameters:
propertyName -
value -


Copyright © 2010. All Rights Reserved.