Class PropertyModelImpl
- java.lang.Object
-
- org.apache.tapestry5.beanmodel.internal.beanmodel.PropertyModelImpl
-
- All Implemented Interfaces:
PropertyModel,AnnotationProvider
public class PropertyModelImpl extends java.lang.Object implements PropertyModel
-
-
Constructor Summary
Constructors Constructor Description PropertyModelImpl(BeanModel model, java.lang.String name, PropertyConduit conduit, Messages messages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyModeldataType(java.lang.String dataType)Changes the data type for the property.<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)Searches for the specified annotation, returning the matching annotation instance.PropertyConduitgetConduit()Returns an object used to read or update the property.java.lang.StringgetDataType()Returns a logical name for the type of UI needed to view or edit the property.java.lang.StringgetId()Returns the id used to access other resources (this is based on the property name, but with any excess punctuation stripped out).java.lang.StringgetLabel()Returns a user-presentable label for the property.java.lang.StringgetPropertyName()Returns the name of the property (which may, in fact, be a property expression).java.lang.ClassgetPropertyType()Returns the type of the property.booleanisSortable()Returns true if the property can be used for sorting.PropertyModellabel(java.lang.String label)Changes the label for the property to the provided value.BeanModelmodel()Returns the containing model, often used for "fluent" construction of the model.PropertyModelsortable(boolean sortable)Updates sortable and returns the model for further changes.
-
-
-
Constructor Detail
-
PropertyModelImpl
public PropertyModelImpl(BeanModel model, java.lang.String name, PropertyConduit conduit, Messages messages)
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:PropertyModelReturns the id used to access other resources (this is based on the property name, but with any excess punctuation stripped out).- Specified by:
getIdin interfacePropertyModel
-
getPropertyType
public java.lang.Class getPropertyType()
Description copied from interface:PropertyModelReturns the type of the property.- Specified by:
getPropertyTypein interfacePropertyModel
-
getConduit
public PropertyConduit getConduit()
Description copied from interface:PropertyModelReturns an object used to read or update the property. For virtual properties (properties that do not actually exist on the bean), the conduit may be null.- Specified by:
getConduitin interfacePropertyModel
-
label
public PropertyModel label(java.lang.String label)
Description copied from interface:PropertyModelChanges the label for the property to the provided value.- Specified by:
labelin interfacePropertyModel- Parameters:
label- new label for property- Returns:
- the property model, for further changes
-
getLabel
public java.lang.String getLabel()
Description copied from interface:PropertyModelReturns a user-presentable label for the property.- Specified by:
getLabelin interfacePropertyModel
-
getPropertyName
public java.lang.String getPropertyName()
Description copied from interface:PropertyModelReturns the name of the property (which may, in fact, be a property expression).- Specified by:
getPropertyNamein interfacePropertyModel
-
model
public BeanModel model()
Description copied from interface:PropertyModelReturns the containing model, often used for "fluent" construction of the model.- Specified by:
modelin interfacePropertyModel
-
dataType
public PropertyModel dataType(java.lang.String dataType)
Description copied from interface:PropertyModelChanges the data type for the property.- Specified by:
dataTypein interfacePropertyModel- Returns:
- the property model, for further changes
-
getDataType
public java.lang.String getDataType()
Description copied from interface:PropertyModelReturns a logical name for the type of UI needed to view or edit the property. This is initially determined from the property type.- Specified by:
getDataTypein interfacePropertyModel
-
isSortable
public boolean isSortable()
Description copied from interface:PropertyModelReturns true if the property can be used for sorting. By default, this is true only if the property type implements Comparable.- Specified by:
isSortablein interfacePropertyModel
-
sortable
public PropertyModel sortable(boolean sortable)
Description copied from interface:PropertyModelUpdates sortable and returns the model for further changes.- Specified by:
sortablein interfacePropertyModel- Returns:
- the property model, for further changes
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
Description copied from interface:AnnotationProviderSearches for the specified annotation, returning the matching annotation instance.- Specified by:
getAnnotationin interfaceAnnotationProvider- Parameters:
annotationClass- used to select the annotation to return- Returns:
- the annotation, or null if not found
-
-