Home » tapestry-src-5.0.19 » org.apache.tapestry5.services » [javadoc | source]
org.apache.tapestry5.services
public interface: BeanModelSource [javadoc | source]

All Known Implementing Classes:
    BeanModelSourceImpl

Used by a component to create a default org.apache.tapestry5.beaneditor.BeanModel for a particular bean class. Also provides support to the model by generating validation information for individual fields.

BeanModels are the basis for the org.apache.tapestry5.corelib.components.BeanEditor and org.apache.tapestry5.corelib.components.Grid comopnents.

Method from org.apache.tapestry5.services.BeanModelSource Summary:
create,   createDisplayModel,   createEditModel
Method from org.apache.tapestry5.services.BeanModelSource Detail:
 public BeanModel<T> create(Class<T> beanClass,
    boolean filterReadOnlyProperties,
    Messages messages)Deprecated! use -  #createDisplayModel(Class, org.apache.tapestry5.ioc.Messages)  or #createEditModel(Class, org.apache.tapestry5.ioc.Messages) 

    Creates a new model used for editing the indicated bean class. The model will represent all read/write properties of the bean. The order of properties is determined from the order of the getter methods in the code, and can be overridden with the org.apache.tapestry5.beaneditor.ReorderProperties annotation. The labels for the properties are derived from the property names, but if the component's message catalog has keys of the form propertyName-label, then those will be used instead.

    Models are mutable, so they are not cached, a fresh instance is created each time.

 public BeanModel<T> createDisplayModel(Class<T> beanClass,
    Messages messages)
    Creates a model for display purposes; this may include properties which are read-only.
 public BeanModel<T> createEditModel(Class<T> beanClass,
    Messages messages)
    Creates a model for edit and update purposes, only properties that are fully read-write are included.