public class BeanModelImpl<T> extends Object implements BeanModel<T>
Constructor and Description |
---|
BeanModelImpl(Class<T> beanType,
PropertyConduitSource propertyConduitSource,
TypeCoercer typeCoercer,
Messages messages,
ObjectLocator locator) |
Modifier and Type | Method and Description |
---|---|
PropertyModel |
add(RelativePosition position,
String existingPropertyName,
String propertyName)
Adds a new property to the model (as with
BeanModel.add(String) ), ordered before or after an existing property. |
PropertyModel |
add(RelativePosition position,
String existingPropertyName,
String propertyName,
PropertyConduit conduit)
Adds a new property to the model, ordered before or after an existing property.
|
PropertyModel |
add(String propertyName)
Adds a new property to the model, returning its mutable model for further refinement.
|
PropertyModel |
add(String propertyName,
PropertyConduit conduit)
Adds a new, synthetic property to the model, returning its mutable model for further refinement.
|
PropertyModel |
addEmpty(String propertyName)
Adds an empty property (one with no property conduit).
|
PropertyModel |
addExpression(String propertyName,
String expression)
Adds a new synthetic property to the model, returning its mutable model for further refinement.
|
BeanModel<T> |
exclude(String... propertyNames)
Removes the named properties from the model, if present.
|
PropertyModel |
get(String propertyName)
Returns the named model.
|
Class<T> |
getBeanType()
Returns the type of bean for which this model was initially created.
|
PropertyModel |
getById(String propertyId)
Returns the identified model.
|
List<String> |
getPropertyNames()
Returns a list of the editable properties of the bean, in presentation order.
|
BeanModel<T> |
include(String... propertyNames)
Re-orders the properties of the model into the specified order.
|
T |
newInstance()
Creates a new bean instance.
|
BeanModel<T> |
reorder(String... propertyNames)
Re-orders the properties of the model into the specified order.
|
String |
toString() |
public BeanModelImpl(Class<T> beanType, PropertyConduitSource propertyConduitSource, TypeCoercer typeCoercer, Messages messages, ObjectLocator locator)
public Class<T> getBeanType()
BeanModel
getBeanType
in interface BeanModel<T>
public T newInstance()
BeanModel
ObjectLocator.autobuild(Class)
,
so a public constructor will be used, and dependencies injected.newInstance
in interface BeanModel<T>
public PropertyModel add(String propertyName)
BeanModel
BeanModel.add(String, org.apache.tapestry5.PropertyConduit)
public PropertyModel addEmpty(String propertyName)
BeanModel
public PropertyModel addExpression(String propertyName, String expression)
BeanModel
addExpression
in interface BeanModel<T>
propertyName
- name of property to addexpression
- expression for the propertypublic PropertyModel add(RelativePosition position, String existingPropertyName, String propertyName, PropertyConduit conduit)
BeanModel
add
in interface BeanModel<T>
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 propertypublic PropertyModel add(RelativePosition position, String existingPropertyName, String propertyName)
BeanModel
BeanModel.add(String)
), ordered before or after an existing property.add
in interface BeanModel<T>
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 addpublic PropertyModel add(String propertyName, PropertyConduit conduit)
BeanModel
add
in interface BeanModel<T>
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 invoke BeanModel.addEmpty(String)
.BeanModel.addExpression(String, String)
public PropertyModel get(String propertyName)
BeanModel
public PropertyModel getById(String propertyId)
BeanModel
getById
in interface BeanModel<T>
propertyId
- matched caselessly against PropertyModel.getId()
public List<String> getPropertyNames()
BeanModel
getPropertyNames
in interface BeanModel<T>
public BeanModel<T> exclude(String... propertyNames)
BeanModel
public BeanModel<T> reorder(String... propertyNames)
BeanModel
public BeanModel<T> include(String... propertyNames)
BeanModel
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.