Class BeanInfoSupport
- All Implemented Interfaces:
BeanInfo
- Direct Known Subclasses:
AccessLogSamplerBeanInfo
,BeanShellBeanInfoSupport
,BoltConnectionElementBeanInfo
,BoltTestElementBeanInfoSupport
,CompareAssertionBeanInfo
,ConstantThroughputTimerBeanInfo
,CSVDataSetBeanInfo
,DataSourceElementBeanInfo
,DebugPostProcessorBeanInfo
,DebugSamplerBeanInfo
,JDBCTestElementBeanInfoSupport
,KeystoreConfigBeanInfo
,MongoScriptSamplerBeanInfo
,MongoSourceElementBeanInfo
,PreciseThroughputTimerBeanInfo
,RandomVariableConfigBeanInfo
,ScriptingBeanInfoSupport
,SyncTimerBeanInfo
To use, subclass it, create a subclass with a parameter-less constructor that:
- Calls super(beanClass)
- Modifies the property descriptors, bean descriptor, etc. at will.
Even before any such modifications, a resource bundle named xxxResources (where xxx is the fully qualified bean class name) will be obtained if available and used to localize the following:
- Bean's display name -- from property displayName.
- Properties' display names -- from properties propertyName.displayName.
- Properties' short descriptions -- from properties propertyName.shortDescription.
The resource bundle will be stored as the bean descriptor's "resourceBundle" attribute, so that it can be used for further localization. TestBeanGUI, for example, uses it to obtain the group's display names from properties groupName.displayName.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default value, must be provided ifNOT_UNDEFINED
is TRUEstatic final String
Default value is not saved; only non-defaults are savedstatic final String
If specified, create a multi-line editorstatic final String
Whether the field disallows JMeter expressions; Boolean, default FALSEstatic final String
Whether the field disallows constant values different from the provided tags; Boolean, default FALSEstatic final String
Whether the field must be defined (i.e.static final String
Pointer to the resource bundle, if any (will generally be null)static final String
static final String
TextEditor propertyFields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
-
Constructor Summary
ModifierConstructorDescriptionprotected
BeanInfoSupport
(Class<? extends TestBean> beanClass) Construct a BeanInfo for the given class. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
createPropertyGroup
(String group, String[] names) Utility method to group and order properties.BeanInfo[]
int
int
getIcon
(int iconKind) protected PropertyDescriptor
Get the property descriptor for the property of the given name.protected PropertyDescriptor
Get the property descriptor for the property of the given name.protected PropertyDescriptor
property
(String name, TypeEditor editor) Get the property descriptor for the property of the given name.protected void
Set the bean's 16x16 colour icon.Methods inherited from class java.beans.SimpleBeanInfo
loadImage
-
Field Details
-
TAGS
- See Also:
-
NOT_UNDEFINED
Whether the field must be defined (i.e. is required); Boolean, defaults to FALSE- See Also:
-
NOT_EXPRESSION
Whether the field disallows JMeter expressions; Boolean, default FALSE- See Also:
-
NOT_OTHER
Whether the field disallows constant values different from the provided tags; Boolean, default FALSE- See Also:
-
MULTILINE
If specified, create a multi-line editor- See Also:
-
DEFAULT
Default value, must be provided ifNOT_UNDEFINED
is TRUE- See Also:
-
DEFAULT_NOT_SAVED
Default value is not saved; only non-defaults are saved- See Also:
-
RESOURCE_BUNDLE
Pointer to the resource bundle, if any (will generally be null)- See Also:
-
TEXT_LANGUAGE
TextEditor property- See Also:
-
-
Constructor Details
-
BeanInfoSupport
Construct a BeanInfo for the given class.- Parameters:
beanClass
- class for which to construct a BeanInfo
-
-
Method Details
-
property
Get the property descriptor for the property of the given name.- Parameters:
name
- property name- Returns:
- descriptor for a property of that name, or null if there's none
-
property
Get the property descriptor for the property of the given name. Sets the GUITYPE to the provided editor.- Parameters:
name
- property nameeditor
- the TypeEditor enum that describes the property editor- Returns:
- descriptor for a property of that name, or null if there's none
-
property
Get the property descriptor for the property of the given name. Sets the GUITYPE to the provided enum.- Parameters:
name
- property nameenumClass
- the enum class that is to be used by the editor- Returns:
- descriptor for a property of that name, or null if there's none
-
setIcon
Set the bean's 16x16 colour icon.- Parameters:
resourceName
- A pathname relative to the directory holding the class file of the current class.
-
createPropertyGroup
Utility method to group and order properties.It will assign the given group name to each of the named properties, and set their order attribute so that they are shown in the given order.
The created groups will get order 1, 2, 3,... in the order in which they are created.
- Parameters:
group
- name of the groupnames
- property names in the desired order
-
getAdditionalBeanInfo
- Specified by:
getAdditionalBeanInfo
in interfaceBeanInfo
- Overrides:
getAdditionalBeanInfo
in classSimpleBeanInfo
-
getBeanDescriptor
- Specified by:
getBeanDescriptor
in interfaceBeanInfo
- Overrides:
getBeanDescriptor
in classSimpleBeanInfo
-
getDefaultEventIndex
public int getDefaultEventIndex()- Specified by:
getDefaultEventIndex
in interfaceBeanInfo
- Overrides:
getDefaultEventIndex
in classSimpleBeanInfo
-
getDefaultPropertyIndex
public int getDefaultPropertyIndex()- Specified by:
getDefaultPropertyIndex
in interfaceBeanInfo
- Overrides:
getDefaultPropertyIndex
in classSimpleBeanInfo
-
getEventSetDescriptors
- Specified by:
getEventSetDescriptors
in interfaceBeanInfo
- Overrides:
getEventSetDescriptors
in classSimpleBeanInfo
-
getIcon
- Specified by:
getIcon
in interfaceBeanInfo
- Overrides:
getIcon
in classSimpleBeanInfo
-
getMethodDescriptors
- Specified by:
getMethodDescriptors
in interfaceBeanInfo
- Overrides:
getMethodDescriptors
in classSimpleBeanInfo
-
getPropertyDescriptors
- Specified by:
getPropertyDescriptors
in interfaceBeanInfo
- Overrides:
getPropertyDescriptors
in classSimpleBeanInfo
-