| spoon.template.Parameter
Parameter | public @interface Parameter(Code) | | This annotation should be placed on templates' fields or methods to indicate
that they represent template parameters. It is only mandatory for names,
literals, and types, where it avoids having to use
spoon.template.TemplateParameter and allows for the direct accesses
of the parameters. A parameter is never considered as a templated element and
it is not necessary to annotate it with a
Local annotation.
|
value | String value(Code) | | Defines the name of the parameter (optional, mostly to avoid name
clashes). By default, the name of a template parameter is the simple name
of the annotated field. However, in some cases, it can be useful to set a
different name to a parameter in order to avoid name clashes, in
particular when a parameter represents the name of a templated field. For
instance:
class T extends Template {
// this parameter will contain the actual value of the _i_ field's name
\@Parameter("_i_")
String __i_;
int _i_;
}
|
|
|