Class BeanUtil

java.lang.Object
io.vertigo.core.util.BeanUtil

public final class BeanUtil extends Object
Utility methods for manipulating JavaBean properties (getter/setter) for all types of objects.
  • Method Details

    • getValue

      public static Object getValue(Object object, String propertyName)
      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 property
      propertyName - the name of the property
      Returns:
      the value of the property
      Throws:
      VSystemException - if the getter method is not found
    • setValue

      public static void setValue(Object object, String propertyName, Object value)
      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 property
      propertyName - the name of the property
      value - the new value of the property
      Throws:
      VSystemException - if the setter method is not found
    • getPropertyDescriptor

      public static PropertyDescriptor getPropertyDescriptor(String propertyName, Class<?> beanClass)
      Returns the PropertyDescriptor of a property.
      Parameters:
      propertyName - the name of the property
      beanClass - the class containing the property
      Returns:
      the PropertyDescriptor of the property
      Throws:
      VSystemException - if no property descriptor is found