Enum PropertyTypeId

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PropertyTypeId>

    public enum PropertyTypeId
    extends java.lang.Enum<PropertyTypeId>
    Enumerates the properties that can be built from the XML. Defining a property in the XML requires the type attribute, which acts as a mnemonic for the type of the property that should be built. The mapping between the values of this attribute and the concrete property that is built is encoded in the constants of this enum.

    Properties API changes

    This class' API is mainly provided to build GUIs for XPath rules like the rule designer, so that they have info about the available properties from XML. As such, the number of clients are probably low. Nevertheless, a bunch of members have been deprecated to warn about probable upcoming API changes with 7.0.0, but the amount of change may be greater. See PropertyDescriptor for more info about property framework changes with 7.0.0.
    Clément Fournier
    See Also:
    • Method Detail

      • values

        public static PropertyTypeId[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PropertyTypeId c : PropertyTypeId.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PropertyTypeId valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getStringId

        public java.lang.String getStringId()
        Gets the value of the type attribute represented by this constant.
        The string id
      • getFactory

        public PropertyDescriptorExternalBuilder<?> getFactory()
        Gets the factory associated to the type id, that can build the property from strings extracted from the XML.
        The factory
      • isPropertyNumeric

        public boolean isPropertyNumeric()
        Returns true if the property corresponding to this factory is numeric, which means it can be safely cast to a NumericPropertyDescriptor.
        whether the property is numeric
      • isPropertyPackaged

        public boolean isPropertyPackaged()
        Returns true if the property corresponding to this factory is packaged, which means it can be safely cast to a PackagedPropertyDescriptor.
        whether the property is packaged
      • isPropertyMultivalue

        public boolean isPropertyMultivalue()
        Returns true if the property corresponding to this factory takes lists of values as its value.
        whether the property is multivalue
      • propertyValueType

        public java.lang.Class<?> propertyValueType()
        Returns the value type of the property corresponding to this factory. This is the component type of the list if the property is multivalued.
        The value type of the property
      • typeIdsToConstants

        public static java.util.Map<java.lang.String,​PropertyTypeId> typeIdsToConstants()
        Returns the full mappings from type ids to enum constants.
        The full mapping.
      • factoryFor

        public static PropertyDescriptorExternalBuilder<?> factoryFor​(java.lang.String stringId)
        Gets the factory for the descriptor identified by the string id.
        stringId - The identifier of the type
        The factory used to build new instances of a descriptor
      • lookupMnemonic

        public static PropertyTypeId lookupMnemonic​(java.lang.String stringId)
        Gets the enum constant corresponding to the given mnemonic.
        stringId - A mnemonic for the property type
        A PropertyTypeId
      • typeIdFor

        public static java.lang.String typeIdFor​(java.lang.Class<?> valueType,
                                                 boolean multiValue)
        The signature will probably be altered in 7.0.0 but a similar functionality will be available
        Gets the string representation of this type, as it should be given when defining a descriptor in the xml.
        valueType - The type to look for
        multiValue - Whether the descriptor is multivalued or not
        The string id