Class EnumPropertyDescriptor

Direct Known Subclasses:
JavaEnumPropertyDescriptor

public class EnumPropertyDescriptor extends SBPropertyDescriptor
PropertyDescriptor for properties that reflect one of a fixed set of String values. For example a WriteMode parameter might have possible values "Read", "Write", "Update".
See Also:
  • Constructor Details

    • EnumPropertyDescriptor

      public EnumPropertyDescriptor(String propertyName, Class<?> beanClass, String[] values) throws IntrospectionException
      Construct an enumerated property descriptor.
      Parameters:
      propertyName - the name of the property
      beanClass - the operator class containing the property
      values - the set of allowable values for the property
      Throws:
      IntrospectionException - if introspection fails
    • EnumPropertyDescriptor

      public EnumPropertyDescriptor(String propertyName, Class<?> beanClass, String readMethodName, String writeMethodName, String[] values) throws IntrospectionException
      Construct an enumerated property descriptor with customized read/write method names.
      Parameters:
      propertyName - the name of the property
      beanClass - the operator class containing the property
      readMethodName - the name of the method used to read the property
      writeMethodName - the name of the method used to write the property
      values - the set of allowable values for the property
      Throws:
      IntrospectionException - if introspection fails
  • Method Details

    • isValidValue

      boolean isValidValue(String val)
      Is value valid?
      Parameters:
      val - value to test
      Returns:
      true if valid
    • getValues

      public String[] getValues()
      Return the list of allowable values for the property.
      Returns:
      allowable values for this property
    • setValues

      public void setValues(String[] values)
      Set the list of allowable values for the property.
      Parameters:
      values - allowable values for this property