public class SBPropertyDescriptor extends PropertyDescriptor
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 java Enum
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 using
Operator.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
SBPropertyDescriptor.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
Modifier and Type | Class and Description |
---|---|
protected static class |
SBPropertyDescriptor.SingleValueSetter
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).
|
Modifier and Type | Field and Description |
---|---|
protected int |
_expressionInputPort
is this property really a StreamBase expression?
|
static int |
NOT_AN_EXPRESSION
contstant to signify that this property is not a StreamBase expression.
|
Constructor and Description |
---|
SBPropertyDescriptor(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.
|
Modifier and Type | Method and Description |
---|---|
SBPropertyDescriptor |
deprecated()
Mark the descriptor as deprecated.
|
SBPropertyDescriptor |
description(String s)
Calls setShortDescription method, but can be chained as in:
new SBPropertyDescriptor("value", Bean.class).description("useful value to set")
|
SBPropertyDescriptor |
displayName(String s)
Calls setDisplayName method, but can be chained as in:
new SBPropertyDescriptor("value", Bean.class).displayName("Important Value")
|
int |
getExpressionInputPort()
Return the input port that this property is bound to.
|
boolean |
getMaskDisplay()
Deprecated.
use
SBPropertyDescriptor.getUIHints() instead |
int |
getMultiLine()
Deprecated.
use
SBPropertyDescriptor.getUIHints() instead |
UIHints |
getUIHints()
Retrieves the currently associated
UIHints object for this property |
boolean |
isDeprecated()
Return whether the property is deprecated.
|
boolean |
isExpression()
Is this property an expression?
|
boolean |
isRequired()
Return whether the property is required.
|
SBPropertyDescriptor |
mask()
Deprecated.
use
SBPropertyDescriptor.setUIHints(UIHints) instead |
SBPropertyDescriptor |
multiline(int size)
Deprecated.
use
SBPropertyDescriptor.setUIHints(UIHints) instead |
SBPropertyDescriptor |
optional()
Mark the descriptor as optional.
|
void |
setDeprecated(boolean deprecated)
Set whether the property is deprecated.
|
void |
setMaskStringDisplay(boolean mask)
Deprecated.
use
SBPropertyDescriptor.setUIHints(UIHints) instead |
void |
setMultiLine(int size)
Deprecated.
use
SBPropertyDescriptor.setUIHints(UIHints) instead |
void |
setRequired(boolean required)
Set whether the property is required.
|
SBPropertyDescriptor |
setUIHints(UIHints hints)
Associate a
UIHints object with this property, providing
StreamBase Studio with additional layout and display information for this
property. |
createPropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethod
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue, toString
public static final int NOT_AN_EXPRESSION
protected int _expressionInputPort
public SBPropertyDescriptor(String propertyName, Class<?> beanClass) throws IntrospectionException
propertyName
- the name of the propertybeanClass
- the operator class containing the propertyIntrospectionException
- if introspection failspublic SBPropertyDescriptor(String propertyName, Class<?> beanClass, String readMethodName, String writeMethodName) throws IntrospectionException
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 propertyIntrospectionException
- if introspection failspublic SBPropertyDescriptor(PropertyDescriptor pd, Class<?> beanClass) throws IntrospectionException
pd
- a property descriptor to copy frombeanClass
- the operator class containing the propertyIntrospectionException
- if introspection failspublic SBPropertyDescriptor optional()
public SBPropertyDescriptor deprecated()
public boolean isExpression()
public int getExpressionInputPort()
public SBPropertyDescriptor displayName(String s)
new SBPropertyDescriptor("value", Bean.class).displayName("Important Value")
s
- The display namepublic SBPropertyDescriptor description(String s)
new SBPropertyDescriptor("value", Bean.class).description("useful value to set")
s
- The display namepublic SBPropertyDescriptor mask()
SBPropertyDescriptor.setUIHints(UIHints)
insteadUIHints
public SBPropertyDescriptor multiline(int size)
SBPropertyDescriptor.setUIHints(UIHints)
insteadsize
- of the edit boxUIHints
public boolean isDeprecated()
public void setDeprecated(boolean deprecated)
deprecated
- true if the property is deprecated, or false if notpublic boolean isRequired()
public void setRequired(boolean required)
required
- true if the property is required, or false if notpublic SBPropertyDescriptor setUIHints(UIHints hints)
UIHints
object with this property, providing
StreamBase Studio with additional layout and display information for this
property.hints
- a new UIHints
object to associate with this property. Must not be null.public UIHints getUIHints()
UIHints
object for this propertyUIHints
public void setMaskStringDisplay(boolean mask)
SBPropertyDescriptor.setUIHints(UIHints)
insteadUIHints
(creating one
if necessary) for this property with the mask property as given.mask
- whether to request character masking for displays of this propertyUIHints
public boolean getMaskDisplay()
SBPropertyDescriptor.getUIHints()
insteadUIHints
(if any).public void setMultiLine(int size)
SBPropertyDescriptor.setUIHints(UIHints)
insteadUIHints
(creating one
if necessary) for this property with the multi line property as given.size
- representing the requested size (in lines) of this property's edit boxUIHints
public int getMultiLine()
SBPropertyDescriptor.getUIHints()
insteadUIHints
(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.