org.apache.jmeter.testbeans
Class BeanInfoSupport
SimpleBeanInfo
org.apache.jmeter.testbeans.BeanInfoSupport
public abstract class BeanInfoSupport
extends SimpleBeanInfo
Support class for test bean beanInfo objects. It will help using the
introspector to get most of the information, to then modify it at will.
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.
DEFAULT
public static final String DEFAULT
NOT_EXPRESSION
public static final String NOT_EXPRESSION
NOT_OTHER
public static final String NOT_OTHER
NOT_UNDEFINED
public static final String NOT_UNDEFINED
RESOURCE_BUNDLE
public static final String RESOURCE_BUNDLE
TAGS
public static final String TAGS
BeanInfoSupport
protected BeanInfoSupport(Class beanClass)
Construct a BeanInfo for the given class.
createPropertyGroup
protected void createPropertyGroup(String group,
String[] names)
Utility method to group and order properties.
It will assing 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.
group
- name of the groupnames
- property names in the desired order
getAdditionalBeanInfo
public BeanInfo[] getAdditionalBeanInfo()
getBeanDescriptor
public BeanDescriptor getBeanDescriptor()
getDefaultEventIndex
public int getDefaultEventIndex()
getDefaultPropertyIndex
public int getDefaultPropertyIndex()
getEventSetDescriptors
public EventSetDescriptor[] getEventSetDescriptors()
getIcon
public Image getIcon(int iconKind)
getMethodDescriptors
public MethodDescriptor[] getMethodDescriptors()
getPropertyDescriptors
public PropertyDescriptor[] getPropertyDescriptors()
property
protected PropertyDescriptor property(String name)
Get the property descriptor for the property of the given name.
- descriptor for a property of that name, or null if there's none
setIcon
protected void setIcon(String resourceName)
Set the bean's 16x16 colour icon.
resourceName
- A pathname relative to the directory holding the class file of
the current class.
Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.