jdk/test/java/beans/Introspector/4058433/TestBeanProperty.java
author serb
Tue, 02 Jun 2015 19:27:06 +0300
changeset 31162 b4c9194f282c
parent 25566 ba387c302edd
child 32482 45ff83ee1ee9
permissions -rw-r--r--
8079084: Behavior of BeanProperty.enumerationValues() contradicts spec Reviewed-by: alexsch, malenkov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25566
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     1
/*
31162
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
25566
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     4
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     8
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    13
 * accompanied this code).
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    14
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    18
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    21
 * questions.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    22
 */
31162
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    23
25566
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    24
import java.beans.BeanProperty;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    25
import java.beans.PropertyChangeListener;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    26
import java.beans.PropertyChangeSupport;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    27
import java.beans.PropertyDescriptor;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    28
import java.util.Arrays;
31162
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    29
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    30
/**
25566
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    31
 * @test
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    32
 * @bug 4058433
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    33
 * @summary Tests the BeanProperty annotation
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    34
 * @author Sergey Malenkov
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    35
 * @library ..
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    36
 */
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    37
public class TestBeanProperty {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    38
    public static void main(String[] args) throws Exception {
31162
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    39
        Class<?>[] types =
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    40
                {B.class, BL.class, BLF.class, E.class, H.class, P.class,
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    41
                 VU.class, D.class, EVD.class, EVE.class, EV.class, EVL.class,
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    42
                 EVX.class};
25566
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    43
        for (Class<?> type : types) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    44
            PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(type, "value");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    45
            if (((B.class == type) || (BLF.class == type)) && pd.isBound()) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    46
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    47
                throw new Error("not bound");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    48
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    49
            if ((BL.class == type) == !pd.isBound()) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    50
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    51
                throw new Error("bound");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    52
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    53
            if ((E.class == type) == !pd.isExpert()) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    54
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    55
                throw new Error("expert");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    56
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    57
            if ((H.class == type) == !pd.isHidden()) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    58
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    59
                throw new Error("hidden");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    60
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    61
            if ((P.class == type) == !pd.isPreferred()) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    62
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    63
                throw new Error("preferred");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    64
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    65
            if ((R.class == type) == !Boolean.TRUE.equals(pd.getValue("required"))) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    66
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    67
                throw new Error("required");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    68
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    69
            if ((VU.class == type) == !Boolean.TRUE.equals(pd.getValue("visualUpdate"))) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    70
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    71
                throw new Error("visualUpdate");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    72
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    73
            if ((EV.class == type) == !isEV(pd, "LEFT", 2, "javax.swing.SwingConstants.LEFT", "RIGHT", 4, "javax.swing.SwingConstants.RIGHT")) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    74
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    75
                throw new Error("enumerationValues from another package");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    76
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    77
            if ((EVL.class == type) == !isEV(pd, "ZERO", 0, "ZERO", "ONE", 1, "ONE")) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    78
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    79
                throw new Error("enumerationValues from another package");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    80
            }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    81
            if ((EVX.class == type) == !isEV(pd, "ZERO", 0, "X.ZERO", "ONE", 1, "X.ONE")) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    82
                BeanUtils.reportPropertyDescriptor(pd);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    83
                throw new Error("enumerationValues from another package");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    84
            }
31162
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    85
            if (EVD.class == type && !isEV(pd)) {
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    86
                BeanUtils.reportPropertyDescriptor(pd);
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    87
                throw new Error("EV:"+ pd.getValue("enumerationValues"));
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    88
            }
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    89
            if (EVE.class == type && !isEV(pd)) {
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    90
                BeanUtils.reportPropertyDescriptor(pd);
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    91
                throw new Error("EV:"+ pd.getValue("enumerationValues"));
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
    92
            }
25566
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    93
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    94
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    95
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    96
    private static boolean isEV(PropertyDescriptor pd, Object... expected) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    97
        Object value = pd.getValue("enumerationValues");
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    98
        return value instanceof Object[] && Arrays.equals((Object[]) value, expected);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    99
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   100
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   101
    public static class B {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   102
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   103
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   104
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   105
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   106
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   107
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   108
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   109
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   110
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   111
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   112
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   113
    public static class BL {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   114
        private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   115
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   116
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   117
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   118
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   119
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   120
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   121
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   122
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   123
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   124
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   125
        public void addPropertyChangeListener(PropertyChangeListener listener) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   126
            this.pcs.addPropertyChangeListener(listener);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   127
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   128
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   129
        public void removePropertyChangeListener(PropertyChangeListener listener) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   130
            this.pcs.removePropertyChangeListener(listener);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   131
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   132
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   133
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   134
    public static class BLF {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   135
        private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   136
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   137
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   138
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   139
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   140
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   141
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   142
        @BeanProperty(bound = false)
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   143
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   144
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   145
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   146
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   147
        public void addPropertyChangeListener(PropertyChangeListener listener) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   148
            this.pcs.addPropertyChangeListener(listener);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   149
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   150
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   151
        public void removePropertyChangeListener(PropertyChangeListener listener) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   152
            this.pcs.removePropertyChangeListener(listener);
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   153
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   154
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   155
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   156
    public static class E {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   157
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   158
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   159
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   160
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   161
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   162
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   163
        @BeanProperty(expert = true)
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   164
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   165
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   166
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   167
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   168
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   169
    public static class H {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   170
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   171
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   172
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   173
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   174
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   175
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   176
        @BeanProperty(hidden = true)
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   177
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   178
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   179
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   180
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   181
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   182
    public static class P {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   183
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   184
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   185
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   186
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   187
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   188
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   189
        @BeanProperty(preferred = true)
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   190
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   191
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   192
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   193
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   194
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   195
    public static class R {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   196
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   197
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   198
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   199
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   200
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   201
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   202
        @BeanProperty(required = true)
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   203
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   204
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   205
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   206
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   207
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   208
    public static class VU {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   209
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   210
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   211
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   212
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   213
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   214
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   215
        @BeanProperty(visualUpdate = true)
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   216
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   217
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   218
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   219
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   220
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   221
    public static class D {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   222
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   223
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   224
        @BeanProperty(description = "getter")
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   225
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   226
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   227
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   228
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   229
        @BeanProperty(description = "setter")
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   230
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   231
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   232
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   233
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   234
31162
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   235
    public static class EVD {
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   236
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   237
        private int value;
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   238
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   239
        public int getValue() {
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   240
            return value;
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   241
        }
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   242
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   243
        @BeanProperty()
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   244
        public void setValue(int value) {
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   245
            this.value = value;
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   246
        }
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   247
    }
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   248
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   249
    public static class EVE {
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   250
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   251
        private int value;
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   252
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   253
        public int getValue() {
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   254
            return value;
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   255
        }
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   256
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   257
        @BeanProperty(enumerationValues = {})
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   258
        public void setValue(int value) {
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   259
            this.value = value;
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   260
        }
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   261
    }
b4c9194f282c 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec
serb
parents: 25566
diff changeset
   262
25566
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   263
    public static class EV {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   264
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   265
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   266
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   267
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   268
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   269
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   270
        @BeanProperty(enumerationValues = {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   271
                "javax.swing.SwingConstants.LEFT",
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   272
                "javax.swing.SwingConstants.RIGHT"})
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   273
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   274
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   275
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   276
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   277
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   278
    public static class EVL {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   279
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   280
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   281
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   282
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   283
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   284
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   285
        @BeanProperty(enumerationValues = {"ZERO", "ONE"})
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   286
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   287
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   288
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   289
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   290
        public static int ZERO = 0;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   291
        public static int ONE = 1;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   292
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   293
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   294
    public static class EVX {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   295
        private int value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   296
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   297
        public int getValue() {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   298
            return this.value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   299
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   300
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   301
        @BeanProperty(enumerationValues = {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   302
                "X.ZERO",
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   303
                "X.ONE"})
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   304
        public void setValue(int value) {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   305
            this.value = value;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   306
        }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   307
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   308
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   309
    public static interface X {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   310
        int ZERO = 0;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   311
        int ONE = 1;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   312
    }
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
   313
}