Package io.vertigo.core.util
Class BeanUtil
java.lang.Object
io.vertigo.core.util.BeanUtil
Utility methods for manipulating JavaBean properties (getter/setter) for all types of objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PropertyDescriptorgetPropertyDescriptor(String propertyName, Class<?> beanClass) Returns the PropertyDescriptor of a property.static ObjectReturns the value of a bean property (e.g., "name" -> object.getName()).static voidSets the value of a bean property (e.g., "name" -> object.setName(value)).
-
Method Details
-
getValue
Returns the value of a bean property (e.g., "name" -> object.getName()). Dot notation is not allowed (e.g., "country.name").- Parameters:
object- the object containing the propertypropertyName- the name of the property- Returns:
- the value of the property
- Throws:
VSystemException- if the getter method is not found
-
setValue
Sets the value of a bean property (e.g., "name" -> object.setName(value)). Dot notation is not allowed (e.g., "country.name").- Parameters:
object- the object containing the propertypropertyName- the name of the propertyvalue- the new value of the property- Throws:
VSystemException- if the setter method is not found
-
getPropertyDescriptor
Returns the PropertyDescriptor of a property.- Parameters:
propertyName- the name of the propertybeanClass- the class containing the property- Returns:
- the PropertyDescriptor of the property
- Throws:
VSystemException- if no property descriptor is found
-