Annotation Type Transient
@Target(METHOD) @Retention(RUNTIME) public @interface Transient
Indicates that an attribute called "transient" should be declared with the given value
when the Introspector
constructs a PropertyDescriptor
or EventSetDescriptor
classes associated with the annotated code element. A true
value for the "transient" attribute indicates to encoders derived from Encoder
that this feature should be ignored.
The Transient
annotation may be used in any of the methods that are involved in a FeatureDescriptor
subclass to identify the transient feature in the annotated class and its subclasses. Normally, the method that starts with "get" is the best place to put the annotation and it is this declaration that takes precedence in the case of multiple annotations being defined for the same feature.
To declare a feature non-transient in a class whose superclass declares it transient, use @Transient(false)
. In all cases, the Introspector
decides if a feature is transient by referring to the annotation on the most specific superclass. If no Transient
annotation is present in any superclass the feature is not transient.
- Since:
- 1.7
Optional Elements
Modifier and Type | Optional Element | Description |
---|---|---|
boolean | value | Returns whether or not the |
Elements
value
boolean value
Returns whether or not the Introspector
should construct artifacts for the annotated method.
- Returns:
- whether or not the
Introspector
should construct artifacts for the annotated method
- Default:
- true
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/beans/Transient.html