Skip to end of metadata
Go to start of metadata

Proposal for enumeration support in Modello

Following MODELLO-26, here is a proposal (under construction) for Enumeration Handling in MODELLO.

Model Syntax

Alternativly, we could consider that the value is a java only indication and put that in java metadata. That would lead to a more compact declaration:

But that would be a correct notation only if the actual values of the enumeration could be considered an indication for the Java plugin only.

Java class declaration

The above model should lead to a Java class, like:

now, question is, where to check for model integrity?

Should we provide a setter (setEnumeration) which would require the parameter to be one of the possible values? Like:

Or just a plain setter, the integrity being the work of the parser. I guess first solution is more interesting....

Data parsing

Now, when it comes to parsing, how should we handle it? Just pass down the value to the setter, and see if it is ok with the value?
Should we provide support (in the xml file) for both the keys and the values?

Say, with the continuum-model:

Do we want to be able to handle

in the data?

Or just:

Or both?

This question is a central one, since, most of the other plugins (xml parsers, xdoc, xsd) will depend on this question...

So waiting for someone to provide an answer there (smile)

  • No labels