Class SBPropertyDescriptor

java.lang.Object
java.beans.FeatureDescriptor
java.beans.PropertyDescriptor
com.streambase.sb.operator.parameter.SBPropertyDescriptor
Direct Known Subclasses:
ConfigurationChooserPropertyDescriptor, EnumPropertyDescriptor, HOCONConfigurationChooserPropertyDescriptor, JavaTypePropertyDescriptor, ResourceFilePropertyDescriptor, SBExpressionPropertyDescriptor

public class SBPropertyDescriptor extends PropertyDescriptor
PropertyDescriptor subclass used by StreamBase operators and adapters to describe a property. The properties are used by Studio to display a user interface to the user, and is used to serialize/deserialize the operator to xml in EventFlow application files.

This class should be used for primitive java properties (int, long, etc.), Timestamp, Schema, String[], and String[][]. Subclasses handle specialized property types that support advanced user interface displays:

Property names must be unique for each operator. In other words, each property name for a specific operator must not have the same name as any other property for that operator.

Since 6.1.3, control over the StreamBase Studio user interface for properties can be achieved by setUIHints(UIHints). See also Parameterizable for how to achieve widget enablement control.

Since 7.3.5, properties of type String[][] are supported. These properties allow a list of paired values (that is, the length of the array for each entry must be exactly two).

Since 7.5, an operator can access the server configuration file, and use of a ConfigurationChooserPropertyDescriptor allows user input in retrieving information contained therein

See Also:
  • Field Details

    • NOT_AN_EXPRESSION

      public static final int NOT_AN_EXPRESSION
      contstant to signify that this property is not a StreamBase expression. We signify that a property is a StreamBaseExpression by assigning the property to an input port.
      See Also:
    • _expressionInputPort

      protected int _expressionInputPort
      is this property really a StreamBase expression?
  • Constructor Details

    • SBPropertyDescriptor

      public SBPropertyDescriptor(String propertyName, Class<?> beanClass) throws IntrospectionException
      Construct a property descriptor.
      Parameters:
      propertyName - the name of the property
      beanClass - the operator class containing the property
      Throws:
      IntrospectionException - if introspection fails
    • SBPropertyDescriptor

      public SBPropertyDescriptor(String propertyName, Class<?> beanClass, String readMethodName, String writeMethodName) throws IntrospectionException
      Construct a property descriptor with non-standard 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
      Throws:
      IntrospectionException - if introspection fails
    • SBPropertyDescriptor

      public SBPropertyDescriptor(PropertyDescriptor pd, Class<?> beanClass) throws IntrospectionException
      Copy a property descriptor.
      Parameters:
      pd - a property descriptor to copy from
      beanClass - the operator class containing the property
      Throws:
      IntrospectionException - if introspection fails
  • Method Details

    • optional

      public SBPropertyDescriptor optional()
      Mark the descriptor as optional.
      Returns:
      this object
    • deprecated

      public SBPropertyDescriptor deprecated()
      Mark the descriptor as deprecated. Deprecated properties do not appear in an operator's property view within Studio and are discarded from StreamBase application files.
      Returns:
      this object
      Since:
      6.3.5
    • isExpression

      public boolean isExpression()
      Is this property an expression?
      Returns:
      is this property an expression?
    • getExpressionInputPort

      public int getExpressionInputPort()
      Return the input port that this property is bound to. May return NOT_AN_EXPRESSION as not all properties are expressions.
      Returns:
      input port that this expression is bound to
    • displayName

      public SBPropertyDescriptor displayName(String s)
      Calls setDisplayName method, but can be chained as in: new SBPropertyDescriptor("value", Bean.class).displayName("Important Value")
      Parameters:
      s - The display name
      Returns:
      this, so the call can be chained
    • description

      public SBPropertyDescriptor description(String s)
      Calls setShortDescription method, but can be chained as in: new SBPropertyDescriptor("value", Bean.class).description("useful value to set")
      Parameters:
      s - The display name
      Returns:
      this, so the call can be chained
    • mask

      Deprecated.
      Calls setMaskStringDisplay(true)
      Returns:
      this, so the call can be chained
      See Also:
    • multiline

      @Deprecated public SBPropertyDescriptor multiline(int size)
      Deprecated.
      Calls setMultiLine(size) to create a multiline edit box
      Parameters:
      size - of the edit box
      Returns:
      this, so the call can be chained
      See Also:
    • isDeprecated

      public boolean isDeprecated()
      Return whether the property is deprecated. Deprecated properties do not appear in an operator's property view within Studio and are discarded from StreamBase application files.
      Returns:
      true if the property is deprecated
      Since:
      6.3.5
    • setDeprecated

      public void setDeprecated(boolean deprecated)
      Set whether the property is deprecated. Deprecated properties do not appear in an operator's property view within Studio and are discarded from StreamBase application files.
      Parameters:
      deprecated - true if the property is deprecated, or false if not
      Since:
      6.3.5
    • isRequired

      public boolean isRequired()
      Return whether the property is required.
      Returns:
      true if the property is required
    • setRequired

      public void setRequired(boolean required)
      Set whether the property is required.
      Parameters:
      required - true if the property is required, or false if not
    • setUIHints

      public SBPropertyDescriptor setUIHints(UIHints hints)
      Associate a UIHints object with this property, providing StreamBase Studio with additional layout and display information for this property.
      Parameters:
      hints - a new UIHints object to associate with this property. Must not be null.
      Returns:
      a descriptor for this property
      Since:
      6.1.2
    • getUIHints

      public UIHints getUIHints()
      Retrieves the currently associated UIHints object for this property
      Returns:
      a non-null UIHints
      Since:
      6.1.2
    • setMaskStringDisplay

      @Deprecated public void setMaskStringDisplay(boolean mask)
      Deprecated.
      For backwards compatibility, this call will set a UIHints (creating one if necessary) for this property with the mask property as given.
      Parameters:
      mask - whether to request character masking for displays of this property
      See Also:
    • getMaskDisplay

      @Deprecated public boolean getMaskDisplay()
      Deprecated.
      use getUIHints() instead
      For backwards compatibility, this call will defer to the associated UIHints (if any).
      Returns:
      whether to mask the characters of this property, if it is a String
    • setMultiLine

      @Deprecated public void setMultiLine(int size)
      Deprecated.
      For backwards compatibility, this call will set a UIHints (creating one if necessary) for this property with the multi line property as given.
      Parameters:
      size - representing the requested size (in lines) of this property's edit box
      See Also:
    • getMultiLine

      @Deprecated public int getMultiLine()
      Deprecated.
      use getUIHints() instead
      For backwards compatibility, this call will defer to the associated UIHints (if any). Note that in versions prior to 6.1.2, this returned 0 to indicate one line. This method now returns 1 in this case.
      Returns:
      an integer representing the number of requested lines. 0 means not set and implies one line.