APIdia Launch Partner
Top Description Methods
java.lang.classfile.attribute

public sealed Interface DeprecatedAttribute

extends Attribute<DeprecatedAttribute>, ClassElement, MethodElement, FieldElement
permits BoundDeprecatedAttribute, UnboundDeprecatedAttribute
Known Direct Implementers
jdk.internal.classfile.impl.BoundAttribute.BoundDeprecatedAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundDeprecatedAttribute
Imports
java.lang.classfile.*, .AttributeMapper.AttributeStability, jdk.internal.classfile.impl.BoundAttribute, .UnboundAttribute

Models the Deprecated attribute (JVMS 4.7.15), which indicates this structure has been superseded.

This attribute can appear on classes, methods, and fields, and permits multiple instances in a structure. It has no data dependency.

This attribute was introduced in the Java SE Platform version 1.1, major version 45.

API Note

When this attribute is present, the Deprecated annotation should also be present in the RuntimeVisibleAnnotations attribute to provide more obvious alerts. The reference implementation of the system Java compiler emits this attribute without the annotation when a @deprecated tag is present in the documentation comments without the annotation.

Since
24
Java Virtual Machine Specification
4.7.15 The Deprecated Attribute
See Also
Attributes#deprecated(), Deprecated

Method Summary

Modifier and TypeMethod and Description
public static DeprecatedAttribute

Returns:

a Deprecated attribute
of
()

Returns a Deprecated attribute.

Inherited from java.lang.classfile.Attribute:
attributeMapperattributeName

Method Detail

ofback to summary
public static DeprecatedAttribute of()

Returns a Deprecated attribute.

Returns:DeprecatedAttribute

a Deprecated attribute