CreateObject method (LotusScript® Language)

This method creates a JavaObject instance base of the JavaClass object.

Defined in

JavaClass

Syntax

Set javaobject = javaclass .CreateObject( Signature[, Argument1, ..., Argumentn])

Parameter

Signature

String. This is a JNI signature representing the constructor to use to initialize the object.

JNI Signature

Description

Examples

Constructor requires

B

byte

(B)V

A byte argument

C

char

(C)V

A char argument

D

double

(D)V

A double argument

F

float

(F)V

A float argument

I

int

(I)V

An int argument

J

long

(J)V

A long argument

S

short

(S)V

A short argument

Z

boolean

(Z)V

A Boolean argument

L<fully-qualified-class>

fully-qualified class

"(Ljava/lang/Integer;)V"

A java.lang.Integer argument

[<sigtype>

Array of <sigtype>

([I)V

An int array

L<fully-qualified-class>;

L<fully-qualified-class>;

I

L<fully-qualified-class>;

fully-qualified class

fully-qualified class

int

fully-qualified class

"(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V"

4 arguments:

java.lang.String,

java.lang.String,

int,

java.lang.String

If the constructor has no parameters, call CreateObject with no parameters:

<javaclass>.CreateObject()

If the constructor has one or more parameters, call CreateObject with a signature parameter as follows:

<javaclass>.CreateObject("(...)V")

where ... represents the types of one the parameters in the table. Note that each signature for a fully-qualified-class must start with an L and end with a semicolon.

Argumentn

The arguments needed by the constructor, varying from 0 to 12. These arguments are optional.

Usage

This method creates a JavaObject instance base of the JavaClass object, and returns a JavaObject reference. By default, the empty constructor is used. Otherwise, the user must specify which constructor by using the signature.

Error thrown

LS2J error if there are any issues regarding the signature or the arguments.

Example