Class ConfigurationChooserPropertyDescriptor
- java.lang.Object
-
- java.beans.FeatureDescriptor
-
- java.beans.PropertyDescriptor
-
- com.streambase.sb.operator.parameter.SBPropertyDescriptor
-
- com.streambase.sb.operator.parameter.ConfigurationChooserPropertyDescriptor
-
public class ConfigurationChooserPropertyDescriptor extends SBPropertyDescriptor
A property descriptor for use by a String-typed Java Operator or Adapter property, for cases that wish to present to the user a chooser (typically a combo box) that allows identifying some data out of the server configuration file's adapter-configurations area.At runtime, the Operator/Adapter may use
Operator.getOperatorConfigurationAccessor()along with the property value to retrieve the data.Specifically, this descriptor is to be created with an
XPathexpression that selectsXPathConstants.NODESET, and more specifically, that is expected to return a list of Attribute nodes, whose values will be presented to the user to select from. The value selected (or entered) is then set to a String property type.The XPath expression supports the use of variables (using the
$varsyntax as specified by the JAXP API); you may use other property names as variable names, and you must declare these variables usingsetLinkedPropertyNames(String...).For example, given this as the contents of the
adapter-configurationselement in the server's configuration file:<adapter-configuration type="myop"> <section name="section1"> ... </section> <section name="section2"> ... </section> </adapter-configuration>
then this xpath:
adapter-configuration[@type="myop"]/section/@namewould let the user select from:
section1andsection2An example XPath expression using a parameter might look like:
adapter-configuration[@type="myop"]/sections/[@name=$section]/@nameNote that
UIHintsproposals are ignored for this descriptor.- Since:
- 7.5
- See Also:
Operator.getOperatorConfigurationAccessor()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.streambase.sb.operator.parameter.SBPropertyDescriptor
SBPropertyDescriptor.SingleValueSetter
-
-
Field Summary
-
Fields inherited from class com.streambase.sb.operator.parameter.SBPropertyDescriptor
_expressionInputPort, NOT_AN_EXPRESSION
-
-
Constructor Summary
Constructors Constructor Description ConfigurationChooserPropertyDescriptor(String xpath, PropertyDescriptor pd, Class<?> beanClass)Copy a property descriptorConfigurationChooserPropertyDescriptor(String propertyName, String xpath, Class<?> beanClass)Standard constructorConfigurationChooserPropertyDescriptor(String propertyName, String xpath, Class<?> beanClass, String readMethodName, String writeMethodName)Construct a property descriptor with non-standard read/write method names
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XPathExpressiongetExpression()String[]getLinkedPropertyNames()ConfigurationChooserPropertyDescriptorsetLinkedPropertyNames(String... propertyNames)Declare property names that are being used in the XPath expression as variables-
Methods inherited from class com.streambase.sb.operator.parameter.SBPropertyDescriptor
deprecated, description, displayName, getExpressionInputPort, getMaskDisplay, getMultiLine, getUIHints, isDeprecated, isExpression, isRequired, mask, multiline, optional, setDeprecated, setMaskStringDisplay, setMultiLine, setRequired, setUIHints
-
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
-
-
-
-
Constructor Detail
-
ConfigurationChooserPropertyDescriptor
public ConfigurationChooserPropertyDescriptor(String propertyName, String xpath, Class<?> beanClass) throws IntrospectionException, XPathExpressionException
Standard constructor- Parameters:
propertyName- the name of the propertyxpath- anXPathexpression string that will select attributes whose values are to be displayed to the userbeanClass- the operator class containing the property- Throws:
IntrospectionException- if introspection failsXPathExpressionException- invalid xpath expression
-
ConfigurationChooserPropertyDescriptor
public ConfigurationChooserPropertyDescriptor(String propertyName, String xpath, Class<?> beanClass, String readMethodName, String writeMethodName) throws IntrospectionException, XPathExpressionException
Construct a property descriptor with non-standard read/write method names- Parameters:
propertyName- the name of the propertyxpath- anXPathexpression string that will select attributes whose values are to be displayed to the userbeanClass- 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 failsXPathExpressionException- invalidXPathexpression
-
ConfigurationChooserPropertyDescriptor
public ConfigurationChooserPropertyDescriptor(String xpath, PropertyDescriptor pd, Class<?> beanClass) throws IntrospectionException, XPathExpressionException
Copy a property descriptor- Parameters:
xpath- anXPathexpression string that will select attributes whose values are to be displayed to the userpd- a property descriptor to copy frombeanClass- the operator class containing the property- Throws:
IntrospectionException- if introspection failsXPathExpressionException- on XPath error
-
-
Method Detail
-
getExpression
public XPathExpression getExpression()
- Returns:
- the
XPathExpressionthis property descriptor was created with
-
setLinkedPropertyNames
public ConfigurationChooserPropertyDescriptor setLinkedPropertyNames(String... propertyNames)
Declare property names that are being used in the XPath expression as variables- Parameters:
propertyNames- names of the other properties to link to- Returns:
- this object to allow method chaining
-
getLinkedPropertyNames
public String[] getLinkedPropertyNames()
- Returns:
- a never-null array of property names used as variables in this descriptor's XPath expression
-
-