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