I'm evaluating Castor (v 0.9.4.3) for few days.
In my xsd-file I've specified minOccurs="1" and maxOccurs="5".
The generated class throws an IndexOutOfBoundsException if I try to add more
than 5 objects:
if (!(_myElementList.size() < 5)) {
throw new IndexOutOfBoundsException();
}
The generated descriptor contains
//-- validation code for: _myElementList
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(1);
fieldValidator.setMaxOccurs(5);
I've removed the code throwing the exception to allow adding of more
elements during unmarshaling,
but the validate() method always returns true.
Why does fieldValidator.setMaxOccurs(5); not cause validate to return false?
Why are regular expressions not checked within the set-Method, but maxOccurs
causes exceptions to be thrown?
Thanks!!
Emil Burtescu
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev