public class ConfigurationChooserPropertyDescriptor extends SBPropertyDescriptor
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
XPath
expression that selects XPathConstants.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 $var
syntax as specified by the JAXP API);
you may use other property names as variable names, and you must declare these variables using
ConfigurationChooserPropertyDescriptor.setLinkedPropertyNames(String...)
.
For example, given this as the contents of the adapter-configurations
element
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/@name
would let the user select from:
section1
and section2
An example XPath expression using a parameter might look like:
adapter-configuration[@type="myop"]/sections/[@name=$section]/@name
Note that UIHints
proposals are ignored for this descriptor.
Operator.getOperatorConfigurationAccessor()
SBPropertyDescriptor.SingleValueSetter
_expressionInputPort, NOT_AN_EXPRESSION
Constructor and Description |
---|
ConfigurationChooserPropertyDescriptor(java.lang.String xpath,
java.beans.PropertyDescriptor pd,
java.lang.Class<?> beanClass)
Copy a property descriptor
|
ConfigurationChooserPropertyDescriptor(java.lang.String propertyName,
java.lang.String xpath,
java.lang.Class<?> beanClass)
Standard constructor
|
ConfigurationChooserPropertyDescriptor(java.lang.String propertyName,
java.lang.String xpath,
java.lang.Class<?> beanClass,
java.lang.String readMethodName,
java.lang.String writeMethodName)
Construct a property descriptor with non-standard read/write method names
|
Modifier and Type | Method and Description |
---|---|
javax.xml.xpath.XPathExpression |
getExpression() |
java.lang.String[] |
getLinkedPropertyNames() |
ConfigurationChooserPropertyDescriptor |
setLinkedPropertyNames(java.lang.String... propertyNames)
Declare property names that are being used in the XPath expression as variables
|
deprecated, description, displayName, getExpressionInputPort, getMaskDisplay, getMultiLine, getUIHints, isDeprecated, isExpression, isRequired, mask, multiline, optional, setDeprecated, setMaskStringDisplay, setMultiLine, setRequired, setUIHints
createPropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethod
public ConfigurationChooserPropertyDescriptor(java.lang.String propertyName, java.lang.String xpath, java.lang.Class<?> beanClass) throws java.beans.IntrospectionException, javax.xml.xpath.XPathExpressionException
propertyName
- the name of the propertyxpath
- an XPath
expression string that will select attributes whose values are to be displayed to the userbeanClass
- the operator class containing the propertyjava.beans.IntrospectionException
- if introspection failsjavax.xml.xpath.XPathExpressionException
- invalid xpath expressionpublic ConfigurationChooserPropertyDescriptor(java.lang.String propertyName, java.lang.String xpath, java.lang.Class<?> beanClass, java.lang.String readMethodName, java.lang.String writeMethodName) throws java.beans.IntrospectionException, javax.xml.xpath.XPathExpressionException
propertyName
- the name of the propertyxpath
- an XPath
expression 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 propertyjava.beans.IntrospectionException
- if introspection failsjavax.xml.xpath.XPathExpressionException
- invalid XPath
expressionpublic ConfigurationChooserPropertyDescriptor(java.lang.String xpath, java.beans.PropertyDescriptor pd, java.lang.Class<?> beanClass) throws java.beans.IntrospectionException, javax.xml.xpath.XPathExpressionException
xpath
- an XPath
expression 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 propertyjava.beans.IntrospectionException
- if introspection failsjavax.xml.xpath.XPathExpressionException
- on XPath errorpublic javax.xml.xpath.XPathExpression getExpression()
XPathExpression
this property descriptor was created withpublic ConfigurationChooserPropertyDescriptor setLinkedPropertyNames(java.lang.String... propertyNames)
propertyNames
- names of the other properties to link topublic java.lang.String[] getLinkedPropertyNames()