The Modello Data Model.
Here's an example of a modello data model.
Top level <model>
The top level <model> must contain an <id> <name> and at least 1 <classes><class> element.
The optional <defaults> tag is commonly used to define properties that the various modello generators use.
The <classes> section.
You can have 1 or more <class> elements within this section.
Each <class> represents a container for a set of <field>s.
Every <field> is a component in the container.
Notes on the <field> section
XML Generator Notes about <field>
- By default each
<field>starts out life as an<element>with text content. - A
<field>can be set to be an attribute on the<class>element by using the<field xml.attribute="true">syntax. field/namebecomes the name of the element (or attribute key).field#xml.tagNamecan be used to change the name of the element (or attribute key)
field/versionis unused.field/descriptionis unused.field/typeis one of the following- boolean
- char
- double
- int
- long
- short
- date
- String
- Boolean
- DOM (currently only supported by xpp3 generators)
- Another
<class>this can only be achieved through an association tag
field/associationallows linking to other classes of the model- generated readers and writers do not enforce the multiplicity rules (yet)
field/associationmust have at a minimum the <type> element defined.field/association/multiplicitydictates the multiplicity of a field (1 or*: 0 to many so far)field/association/typeonly refers to other <class> id's, no java primitives allowed here.field/association/typewill be used to determine the name of the nested elements.- singular form of the field tagname will be used for the nested element name.
s/(.*)ies$/\1y/g-"Properies"becomes"Property"s/(.*(ch)?)es$/\1/g-"Branches"becomes"Branch"s/(.*)s$/\1/g-"Reports"becomes"Report"
field/association#xml.associationTagNamecan be used to specify an overridden nested element name.- To learn more about tagName resolution, see TagName resolution
field#xml.listStyledefaults to "wrapped".- Example of
field#xml.listStyle="wrapped" - Example of
field#xml.listStyle="flat"
- Example of
Labels
