function-mapper"
Maya001122 (talk | contribs) |
m (correct highlight (via JWB)) |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{ZUMLReferencePageHeader}} | |
− | + | '''Syntax:''' | |
<?function-mapper class="..." | <?function-mapper class="..." | ||
− | [arg0="..."] [arg1="..."] [arg2="..."] [arg3="..."]? | + | [''arg0''="..."] [''arg1''="..."] [''arg2''="..."] [''arg3''="..."]?> |
− | |||
− | Specifies the function mapper that will be used by the EL expressions to resolve unknown | + | Specifies the function mapper that will be used by the EL expressions to resolve unknown functions. The specified class must implement the <javadoc type="interface">org.zkoss.xel.FunctionMapper</javadoc> interface. |
− | You can specify multiple variable resolvers with multiple < | + | You can specify multiple variable resolvers with multiple <code>function-mapper</code> directives. The later declared one that has higher priority. |
− | Notice that the < | + | Notice that the <code>function-mapper</code> directives are evaluated before the <code>init</code> directives. |
− | + | == class == | |
− | + | [Optional] | |
− | [Optional] | ||
− | |||
− | A class name | + | A class name must implement the <javadoc type="interface">org.zkoss.xel.FunctionMapper</javadoc> interface. Unlike the <code>init</code> directive, the class name cannot be the class that is defined in zscript codes. |
− | + | == arg0, arg1... == | |
− | + | [Optional] | |
− | [Optional] | ||
− | |||
You could specify any number of arguments. If not specified, the default constructor is assumed. If specified, it will look for the constructor with the signature in the following order: | You could specify any number of arguments. If not specified, the default constructor is assumed. If specified, it will look for the constructor with the signature in the following order: | ||
Line 32: | Line 27: | ||
# Foo() | # Foo() | ||
− | If the first signature is found, the arguments with the name and value are passed to the constructor as an instance of < | + | If the first signature is found, the arguments with the name and value are passed to the constructor as an instance of <code>Map</code>. If the second signature is found, the values of arguments are passed to the constructor as an array of objects. For example, |
− | |||
− | |||
− | |||
− | |||
<source lang="xml"> | <source lang="xml"> | ||
<?function-mapper class="foo.Foo" whatever="anything"?> | <?function-mapper class="foo.Foo" whatever="anything"?> | ||
</source> | </source> | ||
+ | |||
+ | Prior to ZK 3.6.2, only the second signature is checked if one or more argument is specified, and it assumes <code>arg0</code> as the first argument, <code>arg1</code> as the second, and so on. | ||
+ | |||
+ | =Version History= | ||
+ | |||
+ | {| border='1px' | width="100%" | ||
+ | ! Version !! Date !! Content | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | {{ZUMLReferencePageFooter}} |
Latest revision as of 13:28, 19 January 2022
Syntax:
<?function-mapper class="..." [arg0="..."] [arg1="..."] [arg2="..."] [arg3="..."]?>
Specifies the function mapper that will be used by the EL expressions to resolve unknown functions. The specified class must implement the FunctionMapper interface.
You can specify multiple variable resolvers with multiple function-mapper
directives. The later declared one that has higher priority.
Notice that the function-mapper
directives are evaluated before the init
directives.
class
[Optional]
A class name must implement the FunctionMapper interface. Unlike the init
directive, the class name cannot be the class that is defined in zscript codes.
arg0, arg1...
[Optional]
You could specify any number of arguments. If not specified, the default constructor is assumed. If specified, it will look for the constructor with the signature in the following order:
- Foo(Map args)
- Foo(Object[] args)
- Foo()
If the first signature is found, the arguments with the name and value are passed to the constructor as an instance of Map
. If the second signature is found, the values of arguments are passed to the constructor as an array of objects. For example,
<?function-mapper class="foo.Foo" whatever="anything"?>
Prior to ZK 3.6.2, only the second signature is checked if one or more argument is specified, and it assumes arg0
as the first argument, arg1
as the second, and so on.
Version History
Version | Date | Content |
---|---|---|