jdk/src/share/classes/java/beans/Transient.java
changeset 19213 c360667a0da2
parent 5506 202f599c92aa
equal deleted inserted replaced
19212:80526b520497 19213:c360667a0da2
     1 /*
     1 /*
     2  * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    38  * a {@link PropertyDescriptor} or {@link EventSetDescriptor}
    38  * a {@link PropertyDescriptor} or {@link EventSetDescriptor}
    39  * classes associated with the annotated code element.
    39  * classes associated with the annotated code element.
    40  * A {@code true} value for the "transient" attribute
    40  * A {@code true} value for the "transient" attribute
    41  * indicates to encoders derived from {@link Encoder}
    41  * indicates to encoders derived from {@link Encoder}
    42  * that this feature should be ignored.
    42  * that this feature should be ignored.
    43  * <p/>
    43  * <p>
    44  * The {@code Transient} annotation may be be used
    44  * The {@code Transient} annotation may be be used
    45  * in any of the methods that are involved
    45  * in any of the methods that are involved
    46  * in a {@link FeatureDescriptor} subclass
    46  * in a {@link FeatureDescriptor} subclass
    47  * to identify the transient feature in the annotated class and its subclasses.
    47  * to identify the transient feature in the annotated class and its subclasses.
    48  * Normally, the method that starts with "get" is the best place
    48  * Normally, the method that starts with "get" is the best place
    49  * to put the annotation and it is this declaration
    49  * to put the annotation and it is this declaration
    50  * that takes precedence in the case of multiple annotations
    50  * that takes precedence in the case of multiple annotations
    51  * being defined for the same feature.
    51  * being defined for the same feature.
    52  * <p/>
    52  * <p>
    53  * To declare a feature non-transient in a class
    53  * To declare a feature non-transient in a class
    54  * whose superclass declares it transient,
    54  * whose superclass declares it transient,
    55  * use {@code @Transient(false)}.
    55  * use {@code @Transient(false)}.
    56  * In all cases, the {@link Introspector} decides
    56  * In all cases, the {@link Introspector} decides
    57  * if a feature is transient by referring to the annotation
    57  * if a feature is transient by referring to the annotation
    62  * @since 1.7
    62  * @since 1.7
    63  */
    63  */
    64 @Target({METHOD})
    64 @Target({METHOD})
    65 @Retention(RUNTIME)
    65 @Retention(RUNTIME)
    66 public @interface Transient {
    66 public @interface Transient {
       
    67     /**
       
    68      * Returns whether or not the {@code Introspector} should
       
    69      * construct artifacts for the annotated method.
       
    70      * @return whether or not the {@code Introspector} should
       
    71      * construct artifacts for the annotated method
       
    72      */
    67     boolean value() default true;
    73     boolean value() default true;
    68 }
    74 }