Package io.vertigo.core.util
Class BeanUtil
- java.lang.Object
-
- io.vertigo.core.util.BeanUtil
-
public final class BeanUtil extends Object
Méthodes utilitaires pour manipuler les propriétés (getter/setter) des JavaBeans (ie tous les types d'objets).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertyDescriptor
getPropertyDescriptor(String propertyName, Class<?> beanClass)
Retourne le PropertyDescriptor d'une propriété.static Object
getValue(Object object, String propertyName)
Retourne la valeur d'une propriété d'un bean (ex : "name" -> object.getName() ou "country.name" -> object.getCountry().getName()).static void
setValue(Object object, String propertyName, Object value)
Définit la valeur d'une propriété d'un bean (ex : "name" -> object.setName(value) ou "country.name" -> object.getCountry().setName(value)).
-
-
-
Method Detail
-
getValue
public static Object getValue(Object object, String propertyName)
Retourne la valeur d'une propriété d'un bean (ex : "name" -> object.getName() ou "country.name" -> object.getCountry().getName()).- Parameters:
object
- java.lang.ObjectpropertyName
- java.lang.String- Returns:
- java.lang.Object
-
setValue
public static void setValue(Object object, String propertyName, Object value)
Définit la valeur d'une propriété d'un bean (ex : "name" -> object.setName(value) ou "country.name" -> object.getCountry().setName(value)).- Parameters:
object
- java.lang.ObjectpropertyName
- java.lang.Stringvalue
- java.lang.Object
-
getPropertyDescriptor
public static PropertyDescriptor getPropertyDescriptor(String propertyName, Class<?> beanClass)
Retourne le PropertyDescriptor d'une propriété.- Parameters:
propertyName
- java.lang.StringbeanClass
- java.lang.Class- Returns:
- java.beans.PropertyDescriptor
-
-