Hi Tom
On 19/06/13 20:09, tomstark wrote:
Sergey,

One last thing.  In order to implement our own JSON namespace handling
convention we needed to create an instance of the class
JSONUtils.JettisonReader, providing it an XMLStreamReader instance that in
turn takes as a parameter a subclass of MappedNamespaceConvention.

Unfortunately the class JSONUtils.JettisonReader is a private inner class of
JSONUtils, so in order to accomplish our goal we copied the source 100% and
renamed the file within our own source tree.  Rather than maintain this code
separately, we would rather use it as it exists inside the CXF library.

Can we make JSONUtils a public standalone class?

I can create a ticket if you think this is a worthwhile change.

IMHO you should consider extending JSONProvider.createReader(Class<?> type, InputStream is) method instead and implement your custom reader by wrapping and delegating to whatever the superclass returns.

For example, your custom reader will be constructed like this:
class MyReader extends org.apache.cxf.staxutils.DepthXMLStreamReader {

        public MyReader(XMLStreamReader reader) {
            super(reader);
        }
        // override the required XMLstreamReader methods
}

This is better because the reader passed to MyReader my represent a chain of readers, with each of them being similar to MyReader

Give it a try please.

Sergey
Thanks,

Tom



--
View this message in context: 
http://cxf.547215.n5.nabble.com/how-to-specify-default-namespace-in-JSON-tp5728855p5729515.html
Sent from the cxf-user mailing list archive at Nabble.com.



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to