Hi,

One thing is that XMLBeans really is designed around a start-from-Schema 
usecase and a lot of our users are in the situation where the XMLSchema is 
given and they cannot change it. So it would make more sense to say that the 
decode/encode methods must be written in such a way that they are able to 
handle any value that is valid against the Schema.

For the cases where validation is not performed (and the value happens to be 
outside of the supported range), 
org.apache.xmlbeans.impl.values.XmlValueNotSupportedException (or 
XmlValueOutOfRangeException) would make sense.

Radu 

> -----Original Message-----
> From: Wesley Leggette [mailto:wlegge...@cleversafe.com] 
> Sent: Sunday, March 22, 2009 12:08 PM
> To: dev@xmlbeans.apache.org; Radu Preotiuc
> Subject: Re: [PATCH 1 of 1] Added custom user type support
> 
> 
> 
> 
> >
> > Oh, and also, the Wiki presentation of the feature is 
> great, but it's 
> > missing a description of the methods in the handler class. I had to 
> > look at the code to figure out that the method name is 
> "encode/decode" 
> > + unqualified name of the user type. Maybe encode/decode 
> would suffice?
> > Anyway, it has to be documented.
> >
> 
> I added this description to the wiki:
> 
> The XML Schema should be written in a way to ensure that all 
> possible validated {{{SimpleValue}}} input is acceptable. As 
> such, the static handler methods should not throw checked or 
> runtime exceptions if schema validation was successful. In 
> the case where XML validation was not successful it is 
> expected that a runtime exception may be thrown from the 
> static handler method. If callers of the generated code do 
> not validate input before using the convenience methods they 
> should be prepared to handle undefined runtime exceptions.
> 
> Is this reasonable, or is there a specific exception (either 
> runtime or
> checked) that is customary to throw from convenience methods?
> 
> Wesley
> 
> 
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: dev-h...@xmlbeans.apache.org

Reply via email to