Class ReflectivePropertyProvider

    • Constructor Detail

      • ReflectivePropertyProvider

        public ReflectivePropertyProvider()
    • Method Detail

      • getObjectPropertyDefinitions

        public <T> List<Property<T,​?>> getObjectPropertyDefinitions​(Class<T> type,
                                                                          T instance)
        Description copied from interface: PropertyProvider
        Builds a list of property definitions for a given object.
        Specified by:
        getObjectPropertyDefinitions in interface PropertyProvider
        Type Parameters:
        T - Generic type to enforce both type and instance are compatible.
        Parameters:
        type - Type of the object.
        instance - An instance of the object. Can be null.
        Returns:
        A non-null list of Propertys that can be empty.
      • isUsingFakeSettersWhenNotPresent

        public boolean isUsingFakeSettersWhenNotPresent()
        Checks whether a fake setter (i.e. one that does nothing) is returned when there is no setter for a property.
        Returns:
        When true, a fake setter is used instead of a null value (default).
      • setUsingFakeSettersWhenNotPresent

        public void setUsingFakeSettersWhenNotPresent​(boolean usingFakeSettersWhenNotPresent)
        Allows using a fake setter when there is no setter for a given property. This allows setters to be called regardless of whether they exist or not.
        Parameters:
        usingFakeSettersWhenNotPresent - When true and a setter for a property is missing, a fake one will be used instead of null.
      • isUsingFakeGettersWhenNotPresent

        public boolean isUsingFakeGettersWhenNotPresent()
        Checks whether a fake getter (i.e. one that always returns null) is returned when there is no getter for a property.
        Returns:
        When true, a fake getter is used instead of a null value (default).
      • setUsingFakeGettersWhenNotPresent

        public void setUsingFakeGettersWhenNotPresent​(boolean usingFakeGettersWhenNotPresent)
        Allows using a fake getter when there is no getter for a given property. This allows getters to be called regardless of whether they exist or not.
        Parameters:
        usingFakeGettersWhenNotPresent - When true and a getter for a property is missing, a fake one will be used instead of null.