Class EnumeratedMultiProperty<E>

    • Constructor Detail

      • EnumeratedMultiProperty

        @Deprecated
        public EnumeratedMultiProperty​(String theName,
                                       String theDescription,
                                       String[] theLabels,
                                       E[] theChoices,
                                       int[] choiceIndices,
                                       Class<E> valueType,
                                       float theUIOrder)
        Constructor using arrays to define the label-value mappings. The correct construction of the property depends on the correct ordering of the arrays.
        Parameters:
        theName - Name
        theDescription - Description
        theLabels - Labels of the choices
        theChoices - Values that can be chosen
        choiceIndices - Indices of the default values
        valueType - Type of the values
        theUIOrder - UI order
      • EnumeratedMultiProperty

        @Deprecated
        public EnumeratedMultiProperty​(String theName,
                                       String theDescription,
                                       String[] theLabels,
                                       E[] theChoices,
                                       int[] choiceIndices,
                                       float theUIOrder)
        Constructor using arrays to define the label-value mappings. The correct construction of the property depends on the correct ordering of the arrays.
        Parameters:
        theName - Name
        theDescription - Description
        theLabels - Labels of the choices
        theChoices - Values that can be chosen
        choiceIndices - Indices of the default values
        theUIOrder - UI order
      • EnumeratedMultiProperty

        @Deprecated
        public EnumeratedMultiProperty​(String theName,
                                       String theDescription,
                                       Map<String,​E> choices,
                                       List<E> defaultValues,
                                       Class<E> valueType,
                                       float theUIOrder)
        Constructor using a map to define the label-value mappings. The default values are specified with a list.
        Parameters:
        theName - Name
        theDescription - Description
        choices - Map of labels to values
        defaultValues - List of default values
        valueType - Type of the values
        theUIOrder - UI order
    • Method Detail

      • errorFor

        public String errorFor​(List<E> values)
        Deprecated.
        Description copied from interface: PropertyDescriptor
        Validation function that returns a diagnostic error message for a sample property value. Returns null if the value is acceptable.
        Specified by:
        errorFor in interface PropertyDescriptor<E>
        Parameters:
        values - The value to check.
        Returns:
        A diagnostic message.
      • createFrom

        protected E createFrom​(String toParse)
        Deprecated.
        Parse a string and returns an instance of a single value (not a list).
        Parameters:
        toParse - String to parse
        Returns:
        An instance of a value
      • asString

        public String asString​(E item)
        Deprecated.
        Returns a string representation of the value, even if it's null.
        Parameters:
        item - The value to describe
        Returns:
        A string representation of the value
      • isMultiValue

        public final boolean isMultiValue()
        Deprecated.
        Description copied from interface: PropertyDescriptor
        Returns whether the property is multi-valued, i.e. an array of strings,

        As unary property rule properties will return a value of one, you must use the get/setProperty accessors when working with the actual values. When working with multi-value properties then the get/setProperties accessors must be used.

        Specified by:
        isMultiValue in interface PropertyDescriptor<V>
        Returns:
        boolean
      • propertyErrorFor

        public String propertyErrorFor​(Rule rule)
        Deprecated.
        Description copied from interface: PropertyDescriptor
        A convenience method that returns an error string if the rule holds onto a property value that has a problem. Returns null otherwise.
        Specified by:
        propertyErrorFor in interface PropertyDescriptor<V>
        Parameters:
        rule - Rule
        Returns:
        String
      • valueErrorFor

        protected String valueErrorFor​(V value)
        Deprecated.
        Checks a single value for a "missing value" error.
        Parameters:
        value - Value to check
        Returns:
        A descriptive String of the error or null if there was none
      • defaultAsString

        protected String defaultAsString()
        Deprecated.
        Returns a string representation of the default value.
        Returns:
        A string representation of the default value.
      • defaultValue

        public List<V> defaultValue()
        Deprecated.
        Description copied from interface: PropertyDescriptor
        Default value to use when the user hasn't specified one or when they wish to revert to a known-good state.
        Specified by:
        defaultValue in interface PropertyDescriptor<V>
        Returns:
        Object
      • multiValueDelimiter

        public char multiValueDelimiter()
        Deprecated.
        Description copied from interface: MultiValuePropertyDescriptor
        Return the character being used to delimit multiple property values within a single string. You must ensure that this character does not appear within any rule property values to avoid deserialization errors.
        Specified by:
        multiValueDelimiter in interface MultiValuePropertyDescriptor<V>
        Returns:
        char
      • asDelimitedString

        public final String asDelimitedString​(List<V> values)
        Deprecated.
        Description copied from interface: PropertyDescriptor
        Formats the object onto a string suitable for storage within the property map.
        Specified by:
        asDelimitedString in interface PropertyDescriptor<V>
        Parameters:
        values - Object
        Returns:
        String
      • description

        public String description()
        Description copied from interface: PropertyDescriptor
        Describes the property and the role it plays within the rule it is specified for. Could be used in a tooltip.
        Specified by:
        description in interface PropertyDescriptor<T>
        Returns:
        String
      • uiOrder

        public float uiOrder()
        Description copied from interface: PropertyDescriptor
        Denotes the relative order the property field should occupy if we are using an auto-generated UI to display and edit property values. If the value returned has a non-zero fractional part then this is can be used to place adjacent fields on the same row.
        Specified by:
        uiOrder in interface PropertyDescriptor<T>
        Returns:
        The relative order compared to other properties of the same rule
      • preferredRowCount

        public int preferredRowCount()
        Description copied from interface: PropertyDescriptor
        If the datatype is a String then return the preferred number of rows to allocate in the text widget, returns a value of one for all other types. Useful for multi-line XPATH editors.
        Specified by:
        preferredRowCount in interface PropertyDescriptor<T>
        Returns:
        int
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • name

        public String name()
        Description copied from interface: PropertyDescriptor
        The name of the property without spaces as it serves as the key into the property map.
        Specified by:
        name in interface PropertyDescriptor<T>
        Returns:
        String
      • isDefinedExternally

        public boolean isDefinedExternally()
        Description copied from interface: PropertyDescriptor
        True if this descriptor was defined in the ruleset xml. This precision is necessary for the RuleSetWriter to write out the property correctly: if it was defined externally, then its definition must be written out, otherwise only its value.
        Specified by:
        isDefinedExternally in interface PropertyDescriptor<T>
        Returns:
        True if the descriptor was defined in xml