Interface PropertySource

    • Method Detail

      • definePropertyDescriptor

        void definePropertyDescriptor​(PropertyDescriptor<?> propertyDescriptor)
                               throws IllegalArgumentException
        Defines a new property. Properties must be defined before they can be set a value.
        Parameters:
        propertyDescriptor - The property descriptor.
        Throws:
        IllegalArgumentException - If there is already a property defined the same name.
      • getName

        String getName()
        Gets the name of this property source. This is e.g. the name of the rule or renderer.
        Returns:
        The name
      • getPropertyDescriptor

        PropertyDescriptor<?> getPropertyDescriptor​(String name)
        Get the PropertyDescriptor for the given property name.
        Parameters:
        name - The name of the property.
        Returns:
        The PropertyDescriptor for the named property, null if there is no such property defined.
      • getPropertyDescriptors

        List<PropertyDescriptor<?>> getPropertyDescriptors()
        Get the descriptors of all defined properties. The properties are returned sorted by UI order.
        Returns:
        The PropertyDescriptors in UI order.
      • getOverriddenPropertyDescriptors

        List<PropertyDescriptor<?>> getOverriddenPropertyDescriptors()
        Returns a modifiable list of the property descriptors that don't use default values.
        Returns:
        The descriptors that don't use default values
      • getProperty

        <T> T getProperty​(PropertyDescriptor<T> propertyDescriptor)
        Get the typed value for the given property. Multi valued properties return immutable lists.
        Type Parameters:
        T - The underlying type of the property descriptor.
        Parameters:
        propertyDescriptor - The property descriptor.
        Returns:
        The property value.
      • isPropertyOverridden

        boolean isPropertyOverridden​(PropertyDescriptor<?> propertyDescriptor)
        Returns true if the given property has been set to a value somewhere in the XML.
        Parameters:
        propertyDescriptor - The descriptor
        Returns:
        True if the property has been set
      • setProperty

        <T> void setProperty​(PropertyDescriptor<T> propertyDescriptor,
                             T value)
        Set the property value specified. This is also referred to as "overriding" the (default) value of a property.
        Type Parameters:
        T - The underlying type of the property descriptor.
        Parameters:
        propertyDescriptor - The property descriptor.
        value - The value to set.
      • setProperty

        @Deprecated
        <V> void setProperty​(MultiValuePropertyDescriptor<V> propertyDescriptor,
                             V... values)
        Deprecated.
        Sets the value of a multi value property descriptor with a variable number of arguments. This is also referred to as "overriding" the (default) value of a property.
        Type Parameters:
        V - The type of the values
        Parameters:
        propertyDescriptor - The property descriptor for which to add a value
        values - Values
      • getPropertiesByPropertyDescriptor

        Map<PropertyDescriptor<?>,​Object> getPropertiesByPropertyDescriptor()
        Returns an unmodifiable map of descriptors to property values for the current receiver. The returned map has an entry for every defined descriptor (getPropertyDescriptors()), if they were not specified explicitly, then default values are used.
        Returns:
        An unmodifiable map of descriptors to property values
      • getOverriddenPropertiesByPropertyDescriptor

        Map<PropertyDescriptor<?>,​Object> getOverriddenPropertiesByPropertyDescriptor()
        Returns a modifiable map of the property descriptors that don't use default values, to their overridden value. Modifications on the returned map don't affect this property source.
        Returns:
        The descriptors that don't use default values
      • usesDefaultValues

        @Deprecated
        boolean usesDefaultValues()
        Deprecated.
        Has no real utility, will be removed by 7.0.0
        Returns whether this Rule uses default values for properties.
        Returns:
        boolean true if the properties all have default values, false otherwise.
      • useDefaultValueFor

        @Deprecated
        void useDefaultValueFor​(PropertyDescriptor<?> desc)
        Deprecated.
        Has no real utility, and the name is confusing, will be removed by 7.0.0
        Clears out any user-specified value for the property allowing it to use the default value in the descriptor.
        Parameters:
        desc - the property to clear out
      • ignoredProperties

        @Deprecated
        Set<PropertyDescriptor<?>> ignoredProperties()
        Deprecated.
        Has no real utility, will be removed by 7.0.0
        Return the properties that are effectively ignored due to the configuration of the rule and values held by other properties. This can be used to disable corresponding widgets in a UI.
        Returns:
        the properties that are ignored
      • dysfunctionReason

        String dysfunctionReason()
        Returns a description of why the receiver may be dysfunctional. Usually due to missing property values or some kind of conflict between values. Returns null if the receiver is ok.
        Returns:
        String