类 BulkAccessor

  • 所有已实现的接口:
    Serializable

    public abstract class BulkAccessor
    extends Object
    implements Serializable
    A JavaBean bulk accessor, which provides methods capable of getting/setting multiple properties of a JavaBean at once. IMPORTANT NOTE!!! Apparently the order of the methods here is important as I think BulkAccessorFactory makes use of that information in terms of accessing the constructor. Anyway, when I tried to re-arrange them the BulkAccessor creation failed and tests started to fail.
    作者:
    Muga Nishizawa, Shigeru Chiba
    另请参阅:
    序列化表格
    • 字段详细资料

      • target

        protected Class target
      • getters

        protected String[] getters
      • setters

        protected String[] setters
      • types

        protected Class[] types
    • 构造器详细资料

      • BulkAccessor

        protected BulkAccessor()
        Protected access constructor so the generated class has access to it.
    • 方法详细资料

      • getPropertyValues

        public abstract void getPropertyValues​(Object bean,
                                               Object[] values)
        Obtains the values of properties of a given bean.
        参数:
        bean - JavaBean.
        values - the obtained values are stored in this array.
      • setPropertyValues

        public abstract void setPropertyValues​(Object bean,
                                               Object[] values)
        Sets properties of a given bean to specified values.
        参数:
        bean - JavaBean.
        values - the values assinged to properties.
      • getPropertyValues

        public Object[] getPropertyValues​(Object bean)
        Returns the values of properties of a given bean.
        参数:
        bean - JavaBean.
        返回:
        The property values
      • getPropertyTypes

        public Class[] getPropertyTypes()
        Returns the types of properties.
        返回:
        The property types
      • getGetters

        public String[] getGetters()
        Returns the setter names of properties.
        返回:
        The getter names
      • getSetters

        public String[] getSetters()
        Returns the getter names of the properties.
        返回:
        The setter names
      • create

        public static BulkAccessor create​(Class beanClass,
                                          String[] getters,
                                          String[] setters,
                                          Class[] types)
        Creates a new instance of BulkAccessor. The created instance provides methods for setting/getting specified properties at once.
        参数:
        beanClass - the class of the JavaBeans accessed through the created object.
        getters - the names of setter methods for specified properties.
        setters - the names of getter methods for specified properties.
        types - the types of specified properties.
        返回:
        The created BulkAccessor