JOCL provides an XML syntax for constructing arbitrary Java
Object instances. It does not define a full
XML document type (there's no root element), but rather an
XML fragment describing the Objects to be
constructed.

In a JOCL fragment, one may define a series of objects using
the object element. A trivial example is:

<object class="java.util.Date"/>

which constructs an instance of java.util.Date
using the no-argument constructor.

You can list multiple object elements in a fragment. For example,
after processing the JOCL fragment:

<object class="java.util.Date"/>
<object class="java.util.Date"/>

The getTypeArray() method
will return an array composed
of two instances of java.util.Date. The sequence of
Objects in the array
will correspond to the sequence of <object> elements in the JOCL fragment.

As we've seen, when used with no child-elements, the <object>
tag will cause the no-argument constructor of the specified class to be invoked.
It is also possible to nest <object> tags to provide arguments
for the constructor.
For example, the fragment:

When invoked at the "root" level (that is, with no <object> parent),
this will cause the corresponding "object wrapper" to be added to the list of
Objects. The type for these
objects will reflect the proper primitive type, however. When invoked with an
<object> parent, these will be treated as primitive arguments to the
specified Object's constructor. For example, while:

<int value="5"/>
<int value="26"/>
<int value="100"/>

results in three Integer instances being added to the
list of values, with types corresponding to Integer, the fragment:

<int value="5"/>
<int value="26"/>
<int value="100"/>

results in three Integer instances being added to the
list of values, with types corresponding to Integer.TYPE.

Hence if you want to invoke the mypackage.Foo(java.lang.Integer,java.lang.Integer,java.lang.Integer)
constructor, use:

parse

Parses a JOCL document from the specified file, using the
XMLReader specified by the org.xml.sax.driver
property.
The returned JOCLContentHandler will contain the
list of objects described by the file.

parse

Parses a JOCL document from the specified Reader, using the
XMLReader specified by the org.xml.sax.driver
property.
The returned JOCLContentHandler will contain the
list of objects described by the file.

parse

Parses a JOCL document from the specified InputStream, using the
XMLReader specified by the org.xml.sax.driver
property.
The returned JOCLContentHandler will contain the
list of objects described by the file.

parse

Parses a JOCL document from the specified InputSource, using thethe
XMLReader specified by the org.xml.sax.driver
property.
The returned JOCLContentHandler will contain the
list of objects described by the file.

parse

Parses a JOCL document from the specified file, using the
XMLReader specified by the org.xml.sax.driver
property.
The returned JOCLContentHandler will contain the
list of objects described by the file.