...
Type coercions occur when a value passed into a parameter (as bound in a template or in an annotation) does not match the type of the parameter.
For example, consider the Count component:
Code Block | ||
---|---|---|
| ||
public class Count
{
@Parameter
private int start = 1;
@Parameter(required = true)
private int end;
@Parameter
private int value;
. . .
|
java
Here, the type of all three parameters is int
.
However, it is likely that the component will be used as so:
Code Block | ||
---|---|---|
|
...
Merry Christmas: <t:count end="3"> Ho! </t:count>
|
A bare whole number is interpreted by the prop binding prefix as a long
. So this is the long value 3.
...