com.itmill.toolkit.data.util
Class BeanItem

java.lang.Object
  extended by com.itmill.toolkit.data.util.PropertysetItem
      extended by com.itmill.toolkit.data.util.BeanItem
All Implemented Interfaces:
Item, Item.PropertySetChangeNotifier, Cloneable

public class BeanItem
extends PropertysetItem

A wrapper class for adding the Item interface to any Java Bean.

Since:
3.0
Version:
5.3.0
Author:
IT Mill Ltd.

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Item
Item.Editor, Item.PropertySetChangeListener, Item.PropertySetChangeNotifier, Item.Viewer
 
Constructor Summary
BeanItem(Object bean)
           Creates a new instance of BeanItem and adds all properties of a Java Bean to it.
BeanItem(Object bean, Collection propertyIds)
           Creates a new instance of BeanItem and adds all listed properties of a Java Bean to it - in specified order.
BeanItem(Object bean, String[] propertyIds)
           Creates a new instance of BeanItem and adds all listed properties of a Java Bean to it - in specified order.
 
Method Summary
 Object getBean()
          Gets the underlying JavaBean object.
 
Methods inherited from class com.itmill.toolkit.data.util.PropertysetItem
addItemProperty, addListener, clone, equals, getItemProperty, getItemPropertyIds, hashCode, removeItemProperty, removeListener, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanItem

public BeanItem(Object bean)

Creates a new instance of BeanItem and adds all properties of a Java Bean to it. The properties are identified by their respective bean names.

Note : This version only supports introspectable bean properties and their getter and setter methods. Stand-alone is and are methods are not supported.

Parameters:
bean - the Java Bean to copy properties from.

BeanItem

public BeanItem(Object bean,
                Collection propertyIds)

Creates a new instance of BeanItem and adds all listed properties of a Java Bean to it - in specified order. The properties are identified by their respective bean names.

Note : This version only supports introspectable bean properties and their getter and setter methods. Stand-alone is and are methods are not supported.

Parameters:
bean - the Java Bean to copy properties from.
propertyIds - id of the property.

BeanItem

public BeanItem(Object bean,
                String[] propertyIds)

Creates a new instance of BeanItem and adds all listed properties of a Java Bean to it - in specified order. The properties are identified by their respective bean names.

Note : This version only supports introspectable bean properties and their getter and setter methods. Stand-alone is and are methods are not supported.

Parameters:
bean - the Java Bean to copy properties from.
propertyIds - ids of the properties.
Method Detail

getBean

public Object getBean()
Gets the underlying JavaBean object.

Returns:
the bean object.


Copyright © 2000-2009 IT Mill Ltd. All Rights Reserved.