Java Reference
In-Depth Information
ues for each of the annotation elements. Annotations are modifiers and
can appear anywhere a modifier is allowed. Here's how you would use
ClassInfo with class Foo :
[1] The @ character was chosen because it is pronounced "at": A-T, short for Annotation Type.
@ClassInfo (
created = "Jan 31 2005",
createdBy = "James Gosling",
lastModified = "Feb 9 2005",
lastModifiedBy = "Ken Arnold",
revision = 3
)
public class Foo {
// ...
}
The annotation is introduced using the @ character again, followed by
the name of the annotation type. Values for the annotation elements
are provided by a comma-separated list of name=value statements within
parentheses. As you can see, an annotation can contain a lot of textual
information that can easily obscure the actual program, so it is strongly
recommended that you follow a consistent practice of always specifying
annotations first, ahead of any other modifiers, and always on a separ-
ate line.
To use the ClassInfo annotation, a programmer should update the value
for each changed element whenever they edit the source for Foo . Such
updates could be automated through development tools that understand
annotations.
 
 
Search WWH ::




Custom Search