Class ResourceFilePropertyDescriptor
- java.lang.Object
-
- java.beans.FeatureDescriptor
-
- java.beans.PropertyDescriptor
-
- com.streambase.sb.operator.parameter.SBPropertyDescriptor
-
- com.streambase.sb.operator.parameter.ResourceFilePropertyDescriptor
-
public class ResourceFilePropertyDescriptor extends SBPropertyDescriptor
PropertyDescriptor for properties wishing to access external resources at runtime.The Operator field should be of type String (representing a name/path usually to be looked up via the resource search path of the containing application).
The contents of the resource may be retrieved using
Operator.getResourceContents(String)
, giving the value of the String field as the argument, or you may retrieve (if available) aFile
usingOperator.getResourceFile(String)
- Since:
- 6.5 added
restrictFileHints(String[])
to improve user experience selecting a resource in Studio, 7.6.2 aResourceFilePropertyDescriptor.TypeHint
enumeration is provided to indicate to Studio the kind of selector to display - See Also:
SBPropertyDescriptor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResourceFilePropertyDescriptor.TypeHint
-
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 ResourceFilePropertyDescriptor(PropertyDescriptor pd, Class<?> beanClass)
Copy a property descriptor.ResourceFilePropertyDescriptor(String propertyName, Class<?> beanClass)
Constructs a resource descriptor with standard read/write method namesResourceFilePropertyDescriptor(String propertyName, Class<?> beanClass, String readMethodName, String writeMethodName)
Construct a resource descriptor with non-standard read/write method names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceFilePropertyDescriptor.TypeHint
getType()
ResourceFilePropertyDescriptor
restrictFileHints(String[] restrictions)
Sets restrictions on the Studio UI used to display a chooser to select a resource file.ResourceFilePropertyDescriptor
typeHint(ResourceFilePropertyDescriptor.TypeHint type)
-
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
-
ResourceFilePropertyDescriptor
public ResourceFilePropertyDescriptor(String propertyName, Class<?> beanClass) throws IntrospectionException
Constructs a resource descriptor with standard read/write method names- Parameters:
propertyName
- the name of the propertybeanClass
- the operator class containing the property- Throws:
IntrospectionException
- if introspection fails- See Also:
ResourceFilePropertyDescriptor
-
ResourceFilePropertyDescriptor
public ResourceFilePropertyDescriptor(String propertyName, Class<?> beanClass, String readMethodName, String writeMethodName) throws IntrospectionException
Construct a resource 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- See Also:
ResourceFilePropertyDescriptor
-
ResourceFilePropertyDescriptor
public ResourceFilePropertyDescriptor(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- See Also:
ResourceFilePropertyDescriptor
-
-
Method Detail
-
restrictFileHints
public ResourceFilePropertyDescriptor restrictFileHints(String[] restrictions)
Sets restrictions on the Studio UI used to display a chooser to select a resource file.Note that this is a relaxed UI restriction, and does not prevent any value from being typed by the user, nor does it restrict resources the operator can access.
Two kinds of name restrictions are available:
- File extension restrictions must be provided as strings starting with a dot, e.g.
.xml
, and Studio will restrict the chooser to files ending in the provided extension, case insensitively. - All other string restrictions are treated as complete file name restrictions, and Studio will restrict the chooser to files matching the name entirely and exactly, case insensitively.
- Parameters:
restrictions
- see method description, must not be null- Returns:
- this resource file property descriptor for chaining
- Since:
- 6.5
- File extension restrictions must be provided as strings starting with a dot, e.g.
-
typeHint
public ResourceFilePropertyDescriptor typeHint(ResourceFilePropertyDescriptor.TypeHint type)
- Parameters:
type
- the new type hint for this descriptor- Returns:
- this resource file property descriptor for chaining
- Since:
- 7.6.2
- See Also:
ResourceFilePropertyDescriptor.TypeHint
-
getType
public ResourceFilePropertyDescriptor.TypeHint getType()
- Returns:
- the type of resource file this descriptor represents
- Since:
- 7.6.2
- See Also:
ResourceFilePropertyDescriptor.TypeHint
-
-