Fonctionnement de TriggerPattern
Yop à tous,
je m'interroge sur les déclaration/utilisation de variables dans les @TriggerPattern. Pourquoi écrit-on les variables de cette façon : $var ?
Exemple :
Code:
1 2 3 4 5 6 7
| @TriggerPattern(value="for ($type $var : $arr) {\n"+
" $coll.add($var);\n"+
"}\n",
constraints={
@ConstraintVariableType(variable="$arr", type="java.lang.Object[]"),
@ConstraintVariableType(variable="$coll", type="java.util.Collection")
}) |
De même, pourquoi cette fois on utilise $var$ ??
Code:
@TriggerPattern("return $val$;")
Si ça vous parle, n'hésitez pas ;)
Steackfrite