1 /* 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 package java.beans; 26 27 import java.lang.annotation.Documented; 28 import java.lang.annotation.Retention; 29 import java.lang.annotation.Target; 30 31 import static java.lang.annotation.ElementType.METHOD; 32 import static java.lang.annotation.RetentionPolicy.RUNTIME; 33 34 /** 35 * An annotation used to specify some property-related information 36 * for the automatically generated {@link BeanInfo} classes. 37 * This annotation is not used if the annotated class 38 * has a corresponding user-defined {@code BeanInfo} class, 39 * which does not imply the automatic analysis. 40 * 41 * @see BeanInfo#getPropertyDescriptors 42 * @since 9 43 * 44 * @author Sergey A. Malenkov 45 */ 46 @Documented 47 @Target({METHOD}) 48 @Retention(RUNTIME) 49 public @interface BeanProperty { 50 /** 51 * The value that indicates whether the annotated property can be 52 * a {@link PropertyDescriptor#isBound bound} property or not. 53 * This value applies only to the beans that have the 54 * {@link PropertyChangeListener propertyChange} event set. 55 * 56 * @return {@code true} if the annotated property can be a bound property; 57 * {@code false} otherwise. 58 */ 59 boolean bound() default true; 60 61 /** 62 * The value that indicates whether the annotated property is 63 * an {@link PropertyDescriptor#isExpert expert} property or not. 64 * | 1 /* 2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.beans; 27 28 import java.lang.annotation.Documented; 29 import java.lang.annotation.Retention; 30 import java.lang.annotation.Target; 31 32 import static java.lang.annotation.ElementType.METHOD; 33 import static java.lang.annotation.RetentionPolicy.RUNTIME; 34 35 /** 36 * An annotation used to specify some property-related information for the 37 * automatically generated {@link BeanInfo} classes. This annotation is not used 38 * if the annotated class has a corresponding user-defined {@code BeanInfo} 39 * class, which does not imply the automatic analysis. If the read method and 40 * the write method of the property annotated, then the read method annotation 41 * will have more priority and replace the write method annotation. 42 * 43 * @author Sergey A. Malenkov 44 * @see BeanInfo#getPropertyDescriptors 45 * @since 9 46 */ 47 @Documented 48 @Target({METHOD}) 49 @Retention(RUNTIME) 50 public @interface BeanProperty { 51 /** 52 * The value that indicates whether the annotated property can be 53 * a {@link PropertyDescriptor#isBound bound} property or not. 54 * This value applies only to the beans that have the 55 * {@link PropertyChangeListener propertyChange} event set. 56 * 57 * @return {@code true} if the annotated property can be a bound property; 58 * {@code false} otherwise. 59 */ 60 boolean bound() default true; 61 62 /** 63 * The value that indicates whether the annotated property is 64 * an {@link PropertyDescriptor#isExpert expert} property or not. 65 * |