Class BeanModelImpl<T>
java.lang.Object
org.apache.tapestry5.beanmodel.internal.beanmodel.BeanModelImpl<T>
- All Implemented Interfaces:
BeanModel<T>
-
Constructor Summary
ConstructorsConstructorDescriptionBeanModelImpl
(Class<T> beanType, PropertyConduitSource propertyConduitSource, TypeCoercer typeCoercer, Messages messages, ObjectLocator locator) -
Method Summary
Modifier and TypeMethodDescriptionAdds a new property to the model, returning its mutable model for further refinement.add
(String propertyName, PropertyConduit conduit) Adds a new, synthetic property to the model, returning its mutable model for further refinement.add
(RelativePosition position, String existingPropertyName, String propertyName) Adds a new property to the model (as withBeanModel.add(String)
), ordered before or after an existing property.add
(RelativePosition position, String existingPropertyName, String propertyName, PropertyConduit conduit) Adds a new property to the model, ordered before or after an existing property.Adds an empty property (one with no property conduit).addExpression
(String propertyName, String expression) Adds a new synthetic property to the model, returning its mutable model for further refinement.Removes the named properties from the model, if present.Returns the named model.Returns the type of bean for which this model was initially created.Returns the identified model.Returns a list of the editable properties of the bean, in presentation order.Re-orders the properties of the model into the specified order.Creates a new bean instance.Re-orders the properties of the model into the specified order.toString()
-
Constructor Details
-
BeanModelImpl
public BeanModelImpl(Class<T> beanType, PropertyConduitSource propertyConduitSource, TypeCoercer typeCoercer, Messages messages, ObjectLocator locator)
-
-
Method Details
-
getBeanType
Description copied from interface:BeanModel
Returns the type of bean for which this model was initially created.- Specified by:
getBeanType
in interfaceBeanModel<T>
-
newInstance
Description copied from interface:BeanModel
Creates a new bean instance. This is based onObjectLocator.autobuild(Class)
, so a public constructor will be used, and dependencies injected.- Specified by:
newInstance
in interfaceBeanModel<T>
- Returns:
- new instance of the bean
-
add
Description copied from interface:BeanModel
Adds a new property to the model, returning its mutable model for further refinement. The property is added to the end of the list of properties. The property must be real (but may have been excluded if there was no datatype associated with the property). To add a synthetic property, useBeanModel.add(String, org.apache.tapestry5.beanmodel.PropertyConduit)
-
addEmpty
Description copied from interface:BeanModel
Adds an empty property (one with no property conduit). -
addExpression
Description copied from interface:BeanModel
Adds a new synthetic property to the model, returning its mutable model for further refinement. The property is added to the end of the list of properties.- Specified by:
addExpression
in interfaceBeanModel<T>
- Parameters:
propertyName
- name of property to addexpression
- expression for the property- Returns:
- the new property model (for further configuration)
-
add
public PropertyModel add(RelativePosition position, String existingPropertyName, String propertyName, PropertyConduit conduit) Description copied from interface:BeanModel
Adds a new property to the model, ordered before or after an existing property.- Specified by:
add
in interfaceBeanModel<T>
- Parameters:
position
- controls whether the new property is ordered before or after the existing propertyexistingPropertyName
- the name of an existing property (this must exist)propertyName
- the new property to addconduit
- conduit used to read or update the property; this may be null for a synthetic or placeholder property- Returns:
- the new property model (for further configuration)
-
add
public PropertyModel add(RelativePosition position, String existingPropertyName, String propertyName) Description copied from interface:BeanModel
Adds a new property to the model (as withBeanModel.add(String)
), ordered before or after an existing property.- Specified by:
add
in interfaceBeanModel<T>
- Parameters:
position
- controls whether the new property is ordered before or after the existing propertyexistingPropertyName
- the name of an existing property (this must exist)propertyName
- the new property to add- Returns:
- the new property model (for further configuration)
-
add
Description copied from interface:BeanModel
Adds a new, synthetic property to the model, returning its mutable model for further refinement.- Specified by:
add
in interfaceBeanModel<T>
- Parameters:
propertyName
- name of property to addconduit
- the conduit used to read or update the property; this may be null for a synthetic or placeholder property. Instead of passing null, please invokeBeanModel.addEmpty(String)
.- Returns:
- the model for the property
- See Also:
-
get
Description copied from interface:BeanModel
Returns the named model. -
getById
Description copied from interface:BeanModel
Returns the identified model. Property ids are a stripped version of the property name. Case is ignored.- Specified by:
getById
in interfaceBeanModel<T>
- Parameters:
propertyId
- matched caselessly againstPropertyModel.getId()
-
getPropertyNames
Description copied from interface:BeanModel
Returns a list of the editable properties of the bean, in presentation order.- Specified by:
getPropertyNames
in interfaceBeanModel<T>
-
exclude
Description copied from interface:BeanModel
Removes the named properties from the model, if present. It is not considered an error to remove a property that does not exist. -
reorder
Description copied from interface:BeanModel
Re-orders the properties of the model into the specified order. Existing properties that are not indicated are retained, but ordered to the end of the list. -
include
Description copied from interface:BeanModel
Re-orders the properties of the model into the specified order. Existing properties that are not indicated are removed. -
toString
-