Class SBExpressionPropertyDescriptor


public class SBExpressionPropertyDescriptor extends SBPropertyDescriptor
A property descriptor that allows a user to define a property that supports StreamBase expressions. The user will always be presented with a text field to enter a StreamBase expression, and at runtime the server will evaluate the expression in the context of each tuple, and assign the result to the property associated with this descriptor. Studio will not call this property's setter during authoring.

Note that the Operator property may be of any Java primitive type, and the engine will attempt to coerce the result of the expression to the property. Care should be taken to ensure the expression evaluates to a type compatible with the property type used. For example:

  • the expression text "max(input1.timeout,60.0)", given that timeout is a field of type double, is compatible with an Operator property of type double
  • the expression text "input1.targetExecutionVenue", given that targetExecutionVenue is a field of type string, is compatible with an Operator property of type String
Properties can also be of type List or Tuple, but in those cases the read method for the property must have an SBExpressionPropertyType annotation to specify the exact StreamBase type of the property.
Since:
6.0, 6.6 support for properties of type "list" and "tuple"
See Also:
  • Constructor Details

    • SBExpressionPropertyDescriptor

      public SBExpressionPropertyDescriptor(String propertyName, Class<?> beanClass, String readMethodName, String writeMethodName, int expressionInputPort) 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
      expressionInputPort - the input port that this expression is valid against
      Throws:
      IntrospectionException - if introspection fails
    • SBExpressionPropertyDescriptor

      public SBExpressionPropertyDescriptor(String propertyName, Class<?> beanClass, int expressionInputPort) throws IntrospectionException
      Construct a property descriptor.
      Parameters:
      propertyName - the name of the property
      beanClass - the operator class containing the property
      expressionInputPort - the input port that this expression is valid against
      Throws:
      IntrospectionException - if introspection fails
    • SBExpressionPropertyDescriptor

      public SBExpressionPropertyDescriptor(PropertyDescriptor pd, Class<?> beanClass, int expressionInputPort) throws IntrospectionException
      Copy a property descriptor.
      Parameters:
      pd - a property descriptor to copy from
      beanClass - the operator class containing the property
      expressionInputPort - the input port that this expression is valid against
      Throws:
      IntrospectionException - if introspection fails