Default constructor dynamic methods
To map default constructors, a method is generated for
each dynamic class.
Mapping of default constructors
This example
shows how to map a default constructor. A method is generated for
each dynamic class. This method sets the attributes with their default
values, if they exist. The following example includes a function that
adds an instance of a dynamic class Book, with the
default attribute title equal to None.
Here is the schema:
<complexType name="book">
<sequence>
<element name="ident"/>
<element name="title" minOccurs="0" default="None" />
</sequence>
</complexType>
Here is the XOM representation:
Class Book extends IlrXmlObject
{
String ident ;
String title ;
Book (); // default constructor
}
And here is a function in IRL:
function void insertBook() {
// Add a new book, default value: ( ident = null, title="None" )
insert ( new Book() );
}