Class AbstractPropertySource

    • Field Detail

      • propertyDescriptors

        @Deprecated
        protected List<PropertyDescriptor<?>> propertyDescriptors
        Deprecated.
        Will be made private final
        The list of known properties that can be configured.
      • propertyValuesByDescriptor

        @Deprecated
        protected Map<PropertyDescriptor<?>,​Object> propertyValuesByDescriptor
        Deprecated.
        Will be made private final
        The values for each property that were overridden here. Default property values are not contained in this map. In other words, if this map doesn't contain a descriptor which is in propertyDescriptors, then it's assumed to have a default value.
    • Constructor Detail

      • AbstractPropertySource

        public AbstractPropertySource()
    • Method Detail

      • ignoredProperties

        @Deprecated
        public Set<PropertyDescriptor<?>> ignoredProperties()
        Deprecated.
        Description copied from interface: PropertySource
        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.
        Specified by:
        ignoredProperties in interface PropertySource
        Returns:
        the properties that are ignored
      • definePropertyDescriptor

        public void definePropertyDescriptor​(PropertyDescriptor<?> propertyDescriptor)
        Description copied from interface: PropertySource
        Defines a new property. Properties must be defined before they can be set a value.
        Specified by:
        definePropertyDescriptor in interface PropertySource
        Parameters:
        propertyDescriptor - The property descriptor.
      • getPropertySourceType

        protected abstract String getPropertySourceType()
      • getPropertyDescriptor

        public PropertyDescriptor<?> getPropertyDescriptor​(String name)
        Description copied from interface: PropertySource
        Get the PropertyDescriptor for the given property name.
        Specified by:
        getPropertyDescriptor in interface PropertySource
        Parameters:
        name - The name of the property.
        Returns:
        The PropertyDescriptor for the named property, null if there is no such property defined.
      • getProperty

        public <T> T getProperty​(PropertyDescriptor<T> propertyDescriptor)
        Description copied from interface: PropertySource
        Get the typed value for the given property. Multi valued properties return immutable lists.
        Specified by:
        getProperty in interface PropertySource
        Type Parameters:
        T - The underlying type of the property descriptor.
        Parameters:
        propertyDescriptor - The property descriptor.
        Returns:
        The property value.
      • isPropertyOverridden

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

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

        @Deprecated
        public <V> void setProperty​(MultiValuePropertyDescriptor<V> propertyDescriptor,
                                    V... values)
        Deprecated.
        Description copied from interface: PropertySource
        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.
        Specified by:
        setProperty in interface PropertySource
        Type Parameters:
        V - The type of the values
        Parameters:
        propertyDescriptor - The property descriptor for which to add a value
        values - Values
      • getOverriddenPropertiesByPropertyDescriptor

        public final Map<PropertyDescriptor<?>,​Object> getOverriddenPropertiesByPropertyDescriptor()
        Description copied from interface: PropertySource
        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.
        Specified by:
        getOverriddenPropertiesByPropertyDescriptor in interface PropertySource
        Returns:
        The descriptors that don't use default values
      • usesDefaultValues

        @Deprecated
        public boolean usesDefaultValues()
        Deprecated.
        Description copied from interface: PropertySource
        Returns whether this Rule uses default values for properties.
        Specified by:
        usesDefaultValues in interface PropertySource
        Returns:
        boolean true if the properties all have default values, false otherwise.
      • useDefaultValueFor

        @Deprecated
        public void useDefaultValueFor​(PropertyDescriptor<?> desc)
        Deprecated.
        Description copied from interface: PropertySource
        Clears out any user-specified value for the property allowing it to use the default value in the descriptor.
        Specified by:
        useDefaultValueFor in interface PropertySource
        Parameters:
        desc - the property to clear out
      • dysfunctionReason

        public String dysfunctionReason()
        Description copied from interface: PropertySource
        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.
        Specified by:
        dysfunctionReason in interface PropertySource
        Returns:
        String