Interface ClassPropertyAdapter
- All Known Implementing Classes:
ClassPropertyAdapterImpl
public interface ClassPropertyAdapter
Organizes all
PropertyAdapter
s for a particular class.
Only provides access to simple properties. Indexed properties are ignored.
When accessing properties by name, the case of the name is ignored.-
Method Summary
Modifier and TypeMethodDescriptionReads the value of a property.getAnnotation
(Object instance, String propertyName, Class<? extends Annotation> annotationClass) Returns the annotation of a given property for the specified type if such an annotation is present, else null.Returns the type of bean this adapter provides properties for.getPropertyAdapter
(String name) Returns the property adapter with the given name, or null if no such adapter exists.Returns the names of all properties, sorted into alphabetic order.void
Updates the value of a property.
-
Method Details
-
getPropertyNames
Returns the names of all properties, sorted into alphabetic order. This includes true properties (as defined in the JavaBeans specification), but also public fields. Starting in Tapestry 5.3, even public static fields are included.- Returns:
- the property names.
-
getBeanType
Returns the type of bean this adapter provides properties for.- Returns:
- the type of the bean.
-
getPropertyAdapter
Returns the property adapter with the given name, or null if no such adapter exists.- Parameters:
name
- of the property (case is ignored)- Returns:
- the PropertyAdapter instance associated with that property
-
get
Reads the value of a property.- Parameters:
instance
- the object to read a value frompropertyName
- the name of the property to read (case is ignored)- Returns:
- the value
- Throws:
UnsupportedOperationException
- if the property is write onlyIllegalArgumentException
- if property does not exist
-
set
Updates the value of a property.- Parameters:
instance
- the object to updatepropertyName
- the name of the property to update (case is ignored)value
- the value to be set- Throws:
UnsupportedOperationException
- if the property is read onlyIllegalArgumentException
- if property does not exist
-
getAnnotation
Annotation getAnnotation(Object instance, String propertyName, Class<? extends Annotation> annotationClass) Returns the annotation of a given property for the specified type if such an annotation is present, else null.- Parameters:
instance
- the object to read a value frompropertyName
- the name of the property to read (case is ignored)annotationClass
- the type of annotation to return- Returns:
- the Annotation instance
- Throws:
IllegalArgumentException
- if property does not exist- Since:
- 5.4
-