Class BeanPropertyReaderUtil


  • public final class BeanPropertyReaderUtil
    extends Object
    Bean Property Util, read bean property.
    Author:
    Manfred Tremmel
    • Method Detail

      • getNullSaveStringProperty

        public static String getNullSaveStringProperty​(Object pbean,
                                                       String pname)
                                                throws IllegalAccessException,
                                                       InvocationTargetException,
                                                       NoSuchMethodException

        Return the value of the specified property of the specified bean, no matter which property reference format is used, as a String.

        If there is a null value in path hierarchy, exception is cached and null returned.

        Parameters:
        pbean - Bean whose property is to be extracted
        pname - Possibly indexed and/or nested name of the property to be extracted
        Returns:
        The property's value, converted to a String
        Throws:
        IllegalAccessException - if the caller does not have access to the property accessor method
        InvocationTargetException - if the property accessor method throws an exception
        NoSuchMethodException - if an accessor method for this property cannot be found
        See Also:
        BeanUtilsBean.getProperty(java.lang.Object, java.lang.String)
      • getNullSaveProperty

        public static Object getNullSaveProperty​(Object pbean,
                                                 String pname)
                                          throws IllegalAccessException,
                                                 InvocationTargetException,
                                                 NoSuchMethodException

        Return the value of the specified property of the specified bean, no matter which property reference format is used, as a String.

        If there is a null value in path hierarchy, exception is cached and null returned.

        Parameters:
        pbean - Bean whose property is to be extracted
        pname - Possibly indexed and/or nested name of the property to be extracted
        Returns:
        The property's value, converted to a String
        Throws:
        IllegalAccessException - if the caller does not have access to the property accessor method
        InvocationTargetException - if the property accessor method throws an exception
        NoSuchMethodException - if an accessor method for this property cannot be found
        See Also:
        BeanUtilsBean.getProperty(java.lang.Object, java.lang.String)