test/jdk/java/beans/Introspector/BeanUtils.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 5506 jdk/test/java/beans/Introspector/BeanUtils.java@202f599c92aa
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 466
diff changeset
     2
 * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 466
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 466
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 466
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
466
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    24
import java.beans.BeanDescriptor;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
import java.beans.EventSetDescriptor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
import java.beans.IndexedPropertyDescriptor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.beans.IntrospectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.beans.Introspector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.beans.MethodDescriptor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.beans.PropertyDescriptor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * This class contains utilities useful for JavaBeans regression testing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
public final class BeanUtils {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
     * Disables instantiation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    private BeanUtils() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    /**
466
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    43
     * Returns a bean descriptor for specified class.
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    44
     *
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    45
     * @param type  the class to introspect
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    46
     * @return a bean descriptor
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    47
     */
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    48
    public static BeanDescriptor getBeanDescriptor(Class type) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    49
        try {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    50
            return Introspector.getBeanInfo(type).getBeanDescriptor();
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    51
        } catch (IntrospectionException exception) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    52
            throw new Error("unexpected exception", exception);
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    53
        }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    54
    }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    55
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    56
    /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * Returns an array of property descriptors for specified class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * @param type  the class to introspect
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @return an array of property descriptors
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    public static PropertyDescriptor[] getPropertyDescriptors(Class type) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
            return Introspector.getBeanInfo(type).getPropertyDescriptors();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        } catch (IntrospectionException exception) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            throw new Error("unexpected exception", exception);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    /**
466
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    71
     * Returns an array of event set descriptors for specified class.
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    72
     *
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    73
     * @param type  the class to introspect
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    74
     * @return an array of event set descriptors
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    75
     */
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    76
    public static EventSetDescriptor[] getEventSetDescriptors(Class type) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    77
        try {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    78
            return Introspector.getBeanInfo(type).getEventSetDescriptors();
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    79
        } catch (IntrospectionException exception) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    80
            throw new Error("unexpected exception", exception);
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    81
        }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    82
    }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    83
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    84
    /**
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    85
     * Finds an event set descriptor for the class
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    86
     * that matches the event set name.
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    87
     *
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    88
     * @param type  the class to introspect
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    89
     * @param name  the name of the event set to search
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    90
     * @return the {@code EventSetDescriptor} or {@code null}
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    91
     */
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    92
    public static EventSetDescriptor findEventSetDescriptor(Class type, String name) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    93
        EventSetDescriptor[] esds = getEventSetDescriptors(type);
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    94
        for (EventSetDescriptor esd : esds) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    95
            if (esd.getName().equals(name)) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    96
                return esd;
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    97
            }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    98
        }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
    99
        return null;
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   100
    }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   101
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   102
    /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * Finds a property descriptor for the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * that matches the property name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @param type the class to introspect
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @param name the name of the property to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @return the {@code PropertyDescriptor}, {@code IndexedPropertyDescriptor} or {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    public static PropertyDescriptor findPropertyDescriptor(Class type, String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        PropertyDescriptor[] pds = getPropertyDescriptors(type);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        for (PropertyDescriptor pd : pds) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            if (pd.getName().equals(name)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                return pd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    /**
466
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   121
     * Returns a event set descriptor for the class
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   122
     * that matches the property name.
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   123
     *
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   124
     * @param type the class to introspect
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   125
     * @param name the name of the event set to search
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   126
     * @return the {@code EventSetDescriptor}
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   127
     */
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   128
    public static EventSetDescriptor getEventSetDescriptor(Class type, String name) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   129
        EventSetDescriptor esd = findEventSetDescriptor(type, name);
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   130
        if (esd != null) {
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   131
            return esd;
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   132
        }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   133
        throw new Error("could not find event set '" + name + "' in " + type);
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   134
    }
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   135
6acd5ec503a8 4935607: RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE
malenkov
parents: 2
diff changeset
   136
    /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * Returns a property descriptor for the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * that matches the property name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @param type the class to introspect
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * @param name the name of the property to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @return the {@code PropertyDescriptor}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    public static PropertyDescriptor getPropertyDescriptor(Class type, String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        PropertyDescriptor pd = findPropertyDescriptor(type, name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        if (pd != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            return pd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        throw new Error("could not find property '" + name + "' in " + type);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Returns an indexed property descriptor for the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * that matches the property name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * @param type  the class to introspect
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @param name  the name of the property to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @return the {@code IndexedPropertyDescriptor}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    public static IndexedPropertyDescriptor getIndexedPropertyDescriptor(Class type, String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        PropertyDescriptor pd = findPropertyDescriptor(type, name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        if (pd instanceof IndexedPropertyDescriptor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            return (IndexedPropertyDescriptor) pd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        reportPropertyDescriptor(pd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        throw new Error("could not find indexed property '" + name + "' in " + type);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * Reports all the interesting information in an Indexed/PropertyDescrptor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    public static void reportPropertyDescriptor(PropertyDescriptor pd) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        System.out.println("property name:  " + pd.getName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        System.out.println("         type:  " + pd.getPropertyType());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        System.out.println("         read:  " + pd.getReadMethod());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        System.out.println("         write: " + pd.getWriteMethod());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        if (pd instanceof IndexedPropertyDescriptor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            System.out.println(" indexed type: " + ipd.getIndexedPropertyType());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            System.out.println(" indexed read: " + ipd.getIndexedReadMethod());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            System.out.println(" indexed write: " + ipd.getIndexedWriteMethod());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * Reports all the interesting information in an EventSetDescriptor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    public static void reportEventSetDescriptor(EventSetDescriptor esd) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        System.out.println("event set name:   " + esd.getName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        System.out.println(" listener type:   " + esd.getListenerType());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        System.out.println("   method get:    " + esd.getGetListenerMethod());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        System.out.println("   method add:    " + esd.getAddListenerMethod());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        System.out.println("   method remove: " + esd.getRemoveListenerMethod());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * Reports all the interesting information in a MethodDescriptor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    public static void reportMethodDescriptor(MethodDescriptor md) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        System.out.println("method name: " + md.getName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        System.out.println("     method: " + md.getMethod());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
}