Class BeanModelSourceImpl
java.lang.Object
org.apache.tapestry5.beanmodel.internal.services.BeanModelSourceImpl
- All Implemented Interfaces:
BeanModelSource
-
Constructor Summary
ConstructorsConstructorDescriptionBeanModelSourceImpl(TypeCoercer typeCoercer, PropertyAccess propertyAccess, PropertyConduitSource propertyConduitSource, PlasticProxyFactory proxyFactory, DataTypeAnalyzer dataTypeAnalyzer, ObjectLocator locator) -
Method Summary
Modifier and TypeMethodDescription<T> BeanModel<T>Creates a new model used for editing the indicated bean class.<T> BeanModel<T>createDisplayModel(Class<T> beanClass, Messages messages) Creates a model for display purposes; this may include properties which are read-only.<T> 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.
-
Constructor Details
-
BeanModelSourceImpl
public BeanModelSourceImpl(TypeCoercer typeCoercer, PropertyAccess propertyAccess, PropertyConduitSource propertyConduitSource, @ComponentLayer PlasticProxyFactory proxyFactory, @Primary DataTypeAnalyzer dataTypeAnalyzer, ObjectLocator locator)
-
-
Method Details
-
createDisplayModel
Description copied from interface:BeanModelSourceCreates a model for display purposes; this may include properties which are read-only.- Specified by:
createDisplayModelin interfaceBeanModelSource- Parameters:
beanClass- class of object to be edited- Returns:
- a model containing properties that can be presented to the user
-
createEditModel
Description copied from interface:BeanModelSourceCreates a model for edit and update purposes, only properties that are fully read-write are included.- Specified by:
createEditModelin interfaceBeanModelSource- Parameters:
beanClass- class of object to be edited- Returns:
- a model containing properties that can be presented to the user
-
create
public <T> BeanModel<T> create(Class<T> beanClass, boolean filterReadOnlyProperties, Messages messages) Description copied from interface:BeanModelSourceCreates 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 theReorderPropertiesannotation. The labels for the properties are derived from the property names, but if the component's message catalog has keys of the formpropertyName-label, then those will be used instead. Models are mutable, so they are not cached, a fresh instance is created each time.- Specified by:
createin interfaceBeanModelSource- Parameters:
beanClass- class of object to be editedfilterReadOnlyProperties- if true, then properties that are read-only will be skipped (leaving only read-write properties, appropriate forBeanEditForm, etc.). If false, then both read-only and read-write properties will be included (appropriate forGridorBeanDisplay).messages- Used to find explicit overrides of- Returns:
- a model
-