001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jmeter.testbeans;
018:
019: import java.awt.Image;
020: import java.beans.BeanDescriptor;
021: import java.beans.BeanInfo;
022: import java.beans.EventSetDescriptor;
023: import java.beans.MethodDescriptor;
024: import java.beans.PropertyDescriptor;
025:
026: /**
027: * This is the BeanInfo object for the TestBean class. It acts as a "stopper"
028: * for the introspector: we don't want it to look at properties defined at this
029: * or higher classes.
030: * <p>
031: * Note this is really needed since using Introspector.getBeanInfo with a stop
032: * class is not an option because:
033: * <ol>
034: * <li>The API does not define a 3-parameter getBeanInfo in which you can use a
035: * stop class AND flags. [Why? I guess this is a bug in the spec.]
036: * <li>java.beans.Introspector is buggy and, opposite to what's stated in the
037: * Javadocs, only results of getBeanInfo(Class) are actually cached.
038: * </ol>
039: *
040: * @author <a href="mailto:jsalvata@apache.org">Jordi Salvat i Alabart</a>
041: * @version $Revision: 493779 $ updated on $Date: 2007-01-07 17:46:38 +0000 (Sun, 07 Jan 2007) $
042: */
043: public class TestBeanBeanInfo implements BeanInfo {
044:
045: public BeanInfo[] getAdditionalBeanInfo() {
046: return new BeanInfo[0];
047: }
048:
049: /*
050: * (non-Javadoc)
051: *
052: * @see java.beans.BeanInfo#getBeanDescriptor()
053: */
054: public BeanDescriptor getBeanDescriptor() {
055: return null;
056: }
057:
058: /*
059: * (non-Javadoc)
060: *
061: * @see java.beans.BeanInfo#getDefaultEventIndex()
062: */
063: public int getDefaultEventIndex() {
064: return 0;
065: }
066:
067: /*
068: * (non-Javadoc)
069: *
070: * @see java.beans.BeanInfo#getDefaultPropertyIndex()
071: */
072: public int getDefaultPropertyIndex() {
073: return 0;
074: }
075:
076: /*
077: * (non-Javadoc)
078: *
079: * @see java.beans.BeanInfo#getEventSetDescriptors()
080: */
081: public EventSetDescriptor[] getEventSetDescriptors() {
082: return new EventSetDescriptor[0];
083: }
084:
085: /*
086: * (non-Javadoc)
087: *
088: * @see java.beans.BeanInfo#getIcon(int)
089: */
090: public Image getIcon(int iconKind) {
091: return null;
092: }
093:
094: /*
095: * (non-Javadoc)
096: *
097: * @see java.beans.BeanInfo#getMethodDescriptors()
098: */
099: public MethodDescriptor[] getMethodDescriptors() {
100: return new MethodDescriptor[0];
101: }
102:
103: /*
104: * (non-Javadoc)
105: *
106: * @see java.beans.BeanInfo#getPropertyDescriptors()
107: */
108: public PropertyDescriptor[] getPropertyDescriptors() {
109: return new PropertyDescriptor[0];
110: }
111: }
|