Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed bad links due to copy-paste from cwiki-test

...

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
languagejava
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
languagejava

...

  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.

...