Closed GoogleCodeExporter closed 9 years ago
Original comment by joe.bays...@gmail.com
on 26 Sep 2012 at 4:05
Following the above steps I have added
return m_type.validate(...) interface method getValue of
org.genxdm.xs.components.EnumerationDefinition now has to throw
DatatypeException.
Which, in turn, means that it needs to get handled in
SchemaConstraintChecker.checkSimpleType method. Following the practice in this
class I catch that and throw a newly created exception that is derived from
ComponentConstraintException. I also had to add an member to ValidationOutcome,
list the part number from the spec...i.e. the whole thing.
Is this a right thing to do? If an enum valid does not to comply to the
baseType than it would fail in XMLSchemaConverter. Can I presume that this is
it and not bother with SchemaConstraintChecker? Is it possible that despite
XMLSchemaConverter error the code in SchemaConstraintChecker still gets
invoked? If not than I would simply throw an AssertionError and not add any
ComponentConstraintException based exceptions.
I am attaching a patch for easy viewing....Note that it depends on my other
changes so it wouldn't compile until they are committed (if they are
committed). But it should be good enough for the purpose of illustration.
Original comment by yury.ska...@gmail.com
on 18 Oct 2012 at 5:45
Attachments:
If there's going to be an exception, it's going to happen at parse time--the
baseType.validate() still happens in XMLSchemaConverter, and should happen for
any other construction method (one hopes).
Therefore, the possibility of the exception should be nil. Which means catch
and return null, noting it as "never happen."
Of course, the rule for "never happen" in catch clauses is: you should always
put your name, phone number, and time zone, so that if it ever does, someone
can crank-call you at three AM ....
(I'm not going to do that, even though I'm never-happening it, with a comment)
Original comment by aale...@gmail.com
on 24 Oct 2012 at 4:40
This issue was closed by revision r403.
Original comment by aale...@gmail.com
on 24 Oct 2012 at 4:56
Original issue reported on code.google.com by
joe.bays...@gmail.com
on 13 Sep 2012 at 5:40