com.extjs.gxt.ui.client.data.BeanModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gxt Show documentation
Show all versions of gxt Show documentation
Rich Internet Application Framework for GWT
/*
* Sencha GXT 2.3.1a - Sencha for GWT
* Copyright(c) 2007-2013, Sencha, Inc.
* [email protected]
*
* http://www.sencha.com/products/gxt/license/
*/
package com.extjs.gxt.ui.client.data;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.extjs.gxt.ui.client.core.FastMap;
/**
* A ModelData
instance that wraps a bean. BeanModels cannot be
* instantiated directly, rather, they are returned by {@link BeanModelFactory}.
*
*
* Nested beans are supported when creating BeanModel instances with limited
* support for nested lists of beans. Any child lists must be defined with
* java.util.List and must be paramertized with a BeanModelTag class or
* subclass.
*
*
* When working with bean models, avoid setting beans as values, rather, set the
* wrapping bean model instance.
*
* @see BeanModelFactory
*/
public class BeanModel extends BaseModel {
transient protected Object bean;
protected Map nestedModels = new FastMap();
protected List beanProperties = new ArrayList();
protected BeanModel() {
}
/**
* Returns the bean.
*
* @return the bean
*/
@SuppressWarnings("unchecked")
public X getBean() {
return (X) bean;
}
@Override
public Map getProperties() {
Map newMap = new FastMap