Path: blob/master/src/java.desktop/share/classes/java/beans/JavaBean.java
41152 views
/*1* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package java.beans;2526import java.lang.annotation.Documented;27import java.lang.annotation.Retention;28import java.lang.annotation.Target;2930import static java.lang.annotation.ElementType.TYPE;31import static java.lang.annotation.RetentionPolicy.RUNTIME;3233/**34* An annotation used to specify some class-related information35* for the automatically generated {@link BeanInfo} classes.36* This annotation is not used if the annotated class37* has a corresponding user-defined {@code BeanInfo} class,38* which does not imply the automatic analysis.39*40* @see BeanInfo#getBeanDescriptor41* @since 942*43* @author Sergey A. Malenkov44*/45@Documented46@Target({TYPE})47@Retention(RUNTIME)48public @interface JavaBean {49/**50* The {@link BeanDescriptor#getShortDescription short description}51* for the {@link BeanInfo#getBeanDescriptor bean descriptor}52* of the annotated class.53*54* @return the bean description,55* or an empty string if the description is not set.56*/57String description() default "";5859/**60* The name of the default property is used to calculate its61* {@link BeanInfo#getDefaultPropertyIndex index} in the62* {@link BeanInfo#getPropertyDescriptors array} of properties63* defined in the annotated class. If the name is not set or64* the annotated class does not define a property65* with the specified name, the default property index66* will be calculated automatically by the67* {@link Introspector} depending on its state.68*69* @return the name of the default property,70* or an empty string if the name is not set.71*/72String defaultProperty() default "";7374/**75* The name of the default event set is used to calculate its76* {@link BeanInfo#getDefaultEventIndex index} in the77* {@link BeanInfo#getEventSetDescriptors array} of event sets78* defined in the annotated class. If the name is not set or79* the annotated class does not define an event set80* with the specified name, the default event set index81* will be calculated automatically by the82* {@link Introspector} depending on its state.83*84* @return the name of the default event set,85* or an empty string if the name is not set.86*/87String defaultEventSet() default "";88}899091