Class SBPropertyDescriptor
- Direct Known Subclasses:
ConfigurationChooserPropertyDescriptor
,EnumPropertyDescriptor
,HOCONConfigurationChooserPropertyDescriptor
,JavaTypePropertyDescriptor
,ResourceFilePropertyDescriptor
,SBExpressionPropertyDescriptor
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:
-
JavaEnumPropertyDescriptor
displays a drop-down to allow the user to select one value from a javaEnum
-
EnumPropertyDescriptor
displays a drop-down to allow the user to select one string value out of a set -
ResourceFilePropertyDescriptor
displays a drop-down to allow the user to select a valid resource file that is accessible to operators usingOperator.getResourceContents(String)
-
SBExpressionPropertyDescriptor
is used to support the use of the StreamBase expression language to evaluate the property value at runtime. The user will be presented with a text field to enter the expression text in Studio. -
ConfigurationChooserPropertyDescriptor
displays a drop-down to allow the user to select some element contained within the server's configuration file.
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
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
This abstract specialization of Setter assumes that the property type will have a single value (which currently accounts for all property types except string lists). -
Field Summary
Modifier and TypeFieldDescriptionprotected int
is this property really a StreamBase expression?static final int
contstant to signify that this property is not a StreamBase expression. -
Constructor Summary
ConstructorDescriptionSBPropertyDescriptor
(PropertyDescriptor pd, Class<?> beanClass) Copy a property descriptor.SBPropertyDescriptor
(String propertyName, Class<?> beanClass) Construct a property descriptor.SBPropertyDescriptor
(String propertyName, Class<?> beanClass, String readMethodName, String writeMethodName) Construct a property descriptor with non-standard read/write method names. -
Method Summary
Modifier and TypeMethodDescriptionMark the descriptor as deprecated.Calls setShortDescription method, but can be chained as in:new SBPropertyDescriptor("value", Bean.class).description("useful value to set")
Calls setDisplayName method, but can be chained as in:new SBPropertyDescriptor("value", Bean.class).displayName("Important Value")
int
Return the input port that this property is bound to.boolean
Deprecated.int
Deprecated.usegetUIHints()
insteadRetrieves the currently associatedUIHints
object for this propertyboolean
Return whether the property is deprecated.boolean
Is this property an expression?boolean
Return whether the property is required.mask()
Deprecated.usesetUIHints(UIHints)
insteadmultiline
(int size) Deprecated.usesetUIHints(UIHints)
insteadoptional()
Mark the descriptor as optional.void
setDeprecated
(boolean deprecated) Set whether the property is deprecated.void
setMaskStringDisplay
(boolean mask) Deprecated.usesetUIHints(UIHints)
insteadvoid
setMultiLine
(int size) Deprecated.usesetUIHints(UIHints)
insteadvoid
setRequired
(boolean required) Set whether the property is required.setUIHints
(UIHints hints) Associate aUIHints
object with this property, providing StreamBase Studio with additional layout and display information for this property.Methods inherited from class java.beans.PropertyDescriptor
createPropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethod
Methods inherited from class java.beans.FeatureDescriptor
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue, toString
-
Field Details
-
NOT_AN_EXPRESSION
public static final int NOT_AN_EXPRESSIONcontstant 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 _expressionInputPortis this property really a StreamBase expression?
-
-
Constructor Details
-
SBPropertyDescriptor
Construct a property descriptor.- Parameters:
propertyName
- the name of the propertybeanClass
- 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 propertybeanClass
- the operator class containing the propertyreadMethodName
- the name of the method used to read the propertywriteMethodName
- 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 frombeanClass
- the operator class containing the property- Throws:
IntrospectionException
- if introspection fails
-
-
Method Details
-
optional
Mark the descriptor as optional.- Returns:
- this object
-
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
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
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.usesetUIHints(UIHints)
insteadCalls setMaskStringDisplay(true)- Returns:
- this, so the call can be chained
- See Also:
-
multiline
Deprecated.usesetUIHints(UIHints)
insteadCalls 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
Associate aUIHints
object with this property, providing StreamBase Studio with additional layout and display information for this property.- Parameters:
hints
- a newUIHints
object to associate with this property. Must not be null.- Returns:
- a descriptor for this property
- Since:
- 6.1.2
-
getUIHints
Retrieves the currently associatedUIHints
object for this property- Returns:
- a non-null
UIHints
- Since:
- 6.1.2
-
setMaskStringDisplay
Deprecated.usesetUIHints(UIHints)
insteadFor backwards compatibility, this call will set aUIHints
(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.usegetUIHints()
insteadFor backwards compatibility, this call will defer to the associatedUIHints
(if any).- Returns:
- whether to mask the characters of this property, if it is a String
-
setMultiLine
Deprecated.usesetUIHints(UIHints)
insteadFor backwards compatibility, this call will set aUIHints
(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.usegetUIHints()
insteadFor backwards compatibility, this call will defer to the associatedUIHints
(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.
-
getUIHints()
instead