The @MultiLine annotation provides information about the carriage returns in a String
property or action parameter. The annotation indicates that: - the String property or parameter
may contain carriage returns, and
- (optionally) the typical number of such carriage returns, and
- (optionally) that the text should be wrapped (the default is that text is not wrapped).
Reference 96
Draft (reference/recognised-annotations.xml) Recognised Annotations
This may be used by the viewing mechanism to render the property as a multi-line textbox
(or text-editor when changes are permitted), with appropriate wrapping and/or scrollbars. The
syntax is:
@MultiLine([numberOfLines=<typicalNumberOfCRs>]
[,preventWrapping=<false|true>])
For example:
public class BugReport {
@MultiLine(numberOfLines=10)
public String getStepsToReproduce() { ... }
public void setStepsToReproduce(String stepsToReproduce) { ... }
...
}
Here the stepsToReproduce may be displayed in a text area of 10 rows, with no wrapping. A
horizontal scrollbar may appear if the number of characters on any given row exceeds the width.
Another example:
public class Email {
@MultiLine(numberOfLines=20,preventWrapping=false)
public String getBody() { ... }
public void setBody(String body) { ... }
...
}
Here the body will be (likely be) displayed in a text area of 20 rows, with wrapping. If this
annotation is combined with the @TypicalLength, then the likely width of the text area in the
user interface will be the: @TypicalLength / @MultiLine. For example:
public class Email {
@MultiLine(numberOfLines=20,preventWrapping=false)
@TypicalLength(800)
public String getBody() { ... }
public void setBody(String body) { ... }
...
}
Here the body will (likely be) displayed in a text area of 20 rows, with 40 columns.