Class file format already has a way to mark elements with deprecated
attribute. You may want to check
Spec for more information on the deprecated attribute.
The Deprecated annotation is intended to be used by the compiler which
has access to the source code so its marked as a source level
annotation. The compiler generates the class file with the deprecated attribute
as mentioned above.
Even the JSR 175 specification says that the deprecation facility was
implemented in an ad hoc fashion using documentation comments, but could
have been implemented atop a program annotation facility, had one
existed at the time the deprecation facility was designed.
Hope this answers your question.