Programmer Reference : Pragmas : Annotation pragmas
Annotation pragmas
Annotation pragmas are special method expressions used to annotate a method. By themselves, annotation pragmas do nothing; they are simply stored as literals in a CompiledMethod. The Pragma class provides methods for finding and processing methods that contain annotation pragmas.
Pragmas are specified with a syntax that resembles either a keyword or unary message expression enclosed in angle-brackets. So, for example,
<keyword1: arg1 ... keywordN: argN>
for keyword annotation pragmas or
<unaryword>
for unary annotation pragmas.
Other than the presence of the annotation pragmas themselves, there is nothing special about methods containing them.
Annotation pragmas are used by Seaside REST support. In addition, other packages that need their capabilities can operate in a VA Smalltalk environment. One such package is the well-known Pier Content Management System.
While the form of an annotation pragma resembles a message, and in some cases a class might define a message with the same selector, there is no direct relation between them; the content of the annotation pragma is simply used to locate the method that includes it. It is up to the application to determine whether and how to assign a meaning to the annotation pragmas.
Last modified date: 11/09/2015