Kohsuke Kawaguchi wrote:
>
> It occurred to me during the lunch :-) that maybe it's better if those
> interfaces extend from XMLStreamReader and XMLStreamWriter respectively,
> rather than the current approach.
>
> So I propose that we make it:
>
> public interface XMLStreamReaderEx extends XMLStreamReader {
> CharSequence getText() throws XMLStreamException;
> }
>
> The key is that then in the signature of Message/Header classes, we use
> XMLStreamReader, not XMLStreamReaderEx. The contract is that if the
> caller can provide XMLStreamReaderEx instead of XMLStreamReader, it
> should do so, and if the callee can take advantage of XMLStreamReaderEx,
> it should do so by downcasting.
>
> Right now, the only consumer that can take advantage of this Ex version
> is JAXB, and the only producer is FI and XOP. So it seems rather stupid
> to require everyone else to learn about this extension of StAX, when
> this can be made as a private contract between those three components.
> The downcasting doesn't have to happen very often, so it shouldn't
> affect performance, and in that way everyone else doesn't have to learn
> about this new concept.
>
> So I think everyone wins.
>
> Any thoughts?
>
I think this makes good sense.
It does mean that XOP-based writer and reader would have to delegate
lots of methods (unless SJSXP supported those methods directly).
Paul.
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109