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.
      • 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
      • dysfunctionReason

        default 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