1 | package org.apache.jmeter.testbeans;↵ | | 1 | package org.apache.jmeter.testelement;↵
|
|
2 | import java.awt.Image;↵ | | 2 | import java.awt.Image;↵
|
3 | import java.beans.BeanDescriptor;↵ | | 3 | import java.beans.BeanDescriptor;↵
|
4 | import java.beans.BeanInfo;↵ | | 4 | import java.beans.BeanInfo;↵
|
5 | import java.beans.EventSetDescriptor;↵ | | 5 | import java.beans.EventSetDescriptor;↵
|
6 | import java.beans.MethodDescriptor;↵ | | 6 | import java.beans.MethodDescriptor;↵
|
7 | import java.beans.PropertyDescriptor;↵ | | 7 | import java.beans.PropertyDescriptor;↵
|
|
8 | /**↵ | | 8 | /**↵
|
9 | * This is the BeanInfo object for the TestBean class. It acts as a "stopper"↵ | | 9 | * This is the BeanInfo object for the TestBean class. It acts as a "stopper"↵
|
10 | * for the introspector: we don't want it to look at properties defined at this↵ | | 10 | * for the introspector: we don't want it to look at properties defined at this↵
|
11 | * or higher classes.↵ | | 11 | * or higher classes.↵
|
12 | * <p>↵ | | 12 | * <p>↵
|
13 | * Note this is really needed since using Introspector.getBeanInfo with a stop↵ | | 13 | * Note this is really needed since using Introspector.getBeanInfo with a stop↵
|
14 | * class is not an option because:↵ | | 14 | * class is not an option because:↵
|
15 | * <ol>↵ | | 15 | * <ol>↵
|
16 | * <li>The API does not define a 3-parameter getBeanInfo in which you can use a↵ | | 16 | * <li>The API does not define a 3-parameter getBeanInfo in which you can use a↵
|
17 | * stop class AND flags. [Why? I guess this is a bug in the spec.]↵ | | 17 | * stop class AND flags. [Why? I guess this is a bug in the spec.]↵
|
18 | * <li>java.beans.Introspector is buggy and, opposite to what's stated in the↵ | | 18 | * <li>java.beans.Introspector is buggy and, opposite to what's stated in the↵
|
19 | * Javadocs, only results of getBeanInfo(Class) are actually cached.↵ | | 19 | * Javadocs, only results of getBeanInfo(Class) are actually cached.↵
|
20 | * </ol>↵ | | 20 | * </ol>↵
|
21 | * ↵ | | 21 | * ↵
|
22 | * @author <a href="mailto:jsalvata@apache.org">Jordi Salvat i Alabart</a>↵ | | 22 | * @author <a href="mailto:jsalvata@apache.org">Jordi Salvat i Alabart</a>↵
|
23 | * @version $Revision: 493779 $ updated on $Date: 2007-01-07 17:46:38 +0000 (Sun, 07 Jan 2007) $↵ | | 23 | * @version $Revision: 493779 $ updated on $Date: 2007-01-07 17:46:38 +0000 (Sun, 07 Jan 2007) $↵
|
24 | */↵ | | 24 | */↵
|
25 | public class TestBeanBeanInfo implements BeanInfo {↵ | | 25 | public class AbstractTestElementBeanInfo implements BeanInfo {↵
|
|
26 | public BeanInfo[] getAdditionalBeanInfo() {↵ | | 26 | public BeanInfo[] getAdditionalBeanInfo() {↵
|
27 | return new BeanInfo[0];↵ | | 27 | return new BeanInfo[0];↵
|
28 | }↵ | | 28 | }↵
|
|
29 | /*↵ | | 29 | /*↵
|
30 | * (non-Javadoc)↵ | | 30 | * (non-Javadoc)↵
|
31 | * ↵ | | 31 | * ↵
|
32 | * @see java.beans.BeanInfo#getBeanDescriptor()↵ | | 32 | * @see java.beans.BeanInfo#getBeanDescriptor()↵
|
33 | */↵ | | 33 | */↵
|
34 | public BeanDescriptor getBeanDescriptor() {↵ | | 34 | public BeanDescriptor getBeanDescriptor() {↵
|
35 | return null;↵ | | 35 | return null;↵
|
36 | }↵ | | 36 | }↵
|
|
37 | /*↵ | | 37 | /*↵
|
38 | * (non-Javadoc)↵ | | 38 | * (non-Javadoc)↵
|
39 | * ↵ | | 39 | * ↵
|
40 | * @see java.beans.BeanInfo#getDefaultEventIndex()↵ | | 40 | * @see java.beans.BeanInfo#getDefaultEventIndex()↵
|
41 | */↵ | | 41 | */↵
|
42 | public int getDefaultEventIndex() {↵ | | 42 | public int getDefaultEventIndex() {↵
|
43 | return 0;↵ | | 43 | return 0;↵
|
44 | }↵ | | 44 | }↵
|
|
45 | /*↵ | | 45 | /*↵
|
46 | * (non-Javadoc)↵ | | 46 | * (non-Javadoc)↵
|
47 | * ↵ | | 47 | * ↵
|
48 | * @see java.beans.BeanInfo#getDefaultPropertyIndex()↵ | | 48 | * @see java.beans.BeanInfo#getDefaultPropertyIndex()↵
|
49 | */↵ | | 49 | */↵
|
50 | public int getDefaultPropertyIndex() {↵ | | 50 | public int getDefaultPropertyIndex() {↵
|
51 | return 0;↵ | | 51 | return 0;↵
|
52 | }↵ | | 52 | }↵
|
|
53 | /*↵ | | 53 | /*↵
|
54 | * (non-Javadoc)↵ | | 54 | * (non-Javadoc)↵
|
55 | * ↵ | | 55 | * ↵
|
56 | * @see java.beans.BeanInfo#getEventSetDescriptors()↵ | | 56 | * @see java.beans.BeanInfo#getEventSetDescriptors()↵
|
57 | */↵ | | 57 | */↵
|
58 | public EventSetDescriptor[] getEventSetDescriptors() {↵ | | 58 | public EventSetDescriptor[] getEventSetDescriptors() {↵
|
59 | return new EventSetDescriptor[0];↵ | | 59 | return new EventSetDescriptor[0];↵
|
60 | }↵ | | 60 | }↵
|
|
61 | /*↵ | | 61 | /*↵
|
62 | * (non-Javadoc)↵ | | 62 | * (non-Javadoc)↵
|
63 | * ↵ | | 63 | * ↵
|
64 | * @see java.beans.BeanInfo#getIcon(int)↵ | | 64 | * @see java.beans.BeanInfo#getIcon(int)↵
|
65 | */↵ | | 65 | */↵
|
66 | public Image getIcon(int iconKind) {↵ | | 66 | public Image getIcon(int iconKind) {↵
|
67 | return null;↵ | | 67 | return null;↵
|
68 | }↵ | | 68 | }↵
|
|
69 | /*↵ | | 69 | /*↵
|
70 | * (non-Javadoc)↵ | | 70 | * (non-Javadoc)↵
|
71 | * ↵ | | 71 | * ↵
|
72 | * @see java.beans.BeanInfo#getMethodDescriptors()↵ | | 72 | * @see java.beans.BeanInfo#getMethodDescriptors()↵
|
73 | */↵ | | 73 | */↵
|
74 | public MethodDescriptor[] getMethodDescriptors() {↵ | | 74 | public MethodDescriptor[] getMethodDescriptors() {↵
|
75 | return new MethodDescriptor[0];↵ | | 75 | return new MethodDescriptor[0];↵
|
76 | }↵ | | 76 | }↵
|
|
77 | /*↵ | | 77 | /*↵
|
78 | * (non-Javadoc)↵ | | 78 | * (non-Javadoc)↵
|
79 | * ↵ | | 79 | * ↵
|
80 | * @see java.beans.BeanInfo#getPropertyDescriptors()↵ | | 80 | * @see java.beans.BeanInfo#getPropertyDescriptors()↵
|
81 | */↵ | | 81 | */↵
|
82 | public PropertyDescriptor[] getPropertyDescriptors() {↵ | | 82 | public PropertyDescriptor[] getPropertyDescriptors() {↵
|
83 | return new PropertyDescriptor[0];↵ | | 83 | return new PropertyDescriptor[0];↵
|
84 | | | 84 |
|