1 java.invoke
<java.invoke name='name'>
<args /> ?
<body /> !
</java.invoke>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the methode to call. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eargs | null | ||||
Ebody | null |
Returns | |
---|---|
Type | Description |
null | Any type of java type in function of the methode. |
Exceptions
attribute 'name' required
The name of the methode to use has been specified.
expected 'args' while found [...]
The arguments of the function has been specified.
expected 'body' while found [...]
The object on which the operation is executed has not been informed.
Invoke the add methode of the Vector class.
<xsql-script name='java_instance_sample1'> <body> <set name='vector'> <java.newInstance name='java.util.Vector' /> </set> <java.invoke name='add'> <args> <arg type='int'>0</arg> <arg type='object'>zero</arg> </args> <body> <vector/> </body> </java.invoke> </body> </xsql-script>
The possible values which admites the attribute type of the label <arg> are:
boolean
char
byte
short
int
long
float
double
decimal (java.math.BigDecimal)
string (java.lang.String)
date (java.util.Date)
time (java.sql.Time)
timestamp (java.sql.Timestamp)
array (java.util.ArrayList)
map (java.util.HashMap)
objec (java.lang.Object)
Invoke the methode intValue about a Number to obtain the whole value of the number. In the example the number is a decimal 2.4 and the function intValue will return the integer 2.
<xsql-script name='java_invoke_number_intValue'> <body> <println> <java.invoke name='intValue'> <args /> <body> <number>2.4</number> </body> </java.invoke> </println> </body> </xsql-script>