Placeholders
Vocabulary phrase templates contain placeholders. Placeholders represent gaps in phrases that can
be filled in either automatically or manually when editing rules. Placeholders are identified by
curly brackets {}.
There are three types of placeholder:
-
Subject placeholders, which are completed automatically
-
{this}placeholders and argument placeholders, which you complete manually when editing rules
To set a different text for an argument placeholder, use the syntax {x, "my
text"} in the phrase template.
Subject placeholder
Subject placeholders are shown in navigation phrases. The subject is a business term that you can edit in the vocabulary file. The subject corresponds to the return type of a member.
The subject placeholder is optional. When used in rules, the subject placeholder automatically takes the appropriate number and article for the context. In the placeholder text, the subject needs to be specified using the singular form, without article.
{this} placeholder
The {this} placeholder represents the declaring class of a member. You cannot
use this placeholder in the verbalization of static members.
For example, for an attribute lastName of type String in class
Customer, you can specify the following phrase template:
{last name} of {this}
Argument placeholder
Argument placeholders represent the arguments of methods. They are represented by the index of the argument.
For example, the action phrase in {this}, display the message : {0} is the
verbalization of the method Session.displayMessage(String). {0} is
the argument placeholder for a String.
- Vocabulary
-
org.samples.Session.displayMessage(java.lang.String)#phrase.action = in {this}, display the message : {0} - Example
-
then in 'current session' , display the message : <a string> ;