Skip to main content

[json-processing-spec users] [jsr353-experts] Re: JsonBuilder and JsonReader as interfaces

  • From: Jörn Horstmann < >
  • To:
  • Subject: [json-processing-spec users] [jsr353-experts] Re: JsonBuilder and JsonReader as interfaces
  • Date: Tue, 04 Dec 2012 22:03:33 +0100
  • List-id: <jsr353-experts.json-processing-spec.java.net>

On 12/04/2012 08:49 PM, Jitendra Kotamraju wrote:


The only downside I see would be even more static methods in the Json
class. Maybe some of these methods should be removed anyway as they
could be replaced by calls to Json.createParserFactory and
Json.createGeneratorFactory, leaving only the most common parameter
variations.
Can you provide the info about which methods can be removed ? Are you
thinking of removing Json.createParser() etc and use
Json.createParserFactory() always ?

Making JsonReader an interface would add another 10 methods to the Json class, mirroring the createParser methods. My suggestion to remove methods was just in case someone might find this makes the Json class too bloated. I would be OK either way.

Theoretically it might be nice to only have a single way to create parsers, but it is convenient to keep the most common methods as static in the Json class. IMHO the most common ones are

createParser(Reader)
createParser(InputStream)
maybe adding createParser(String)

The more advanced create methods taking charset or configuration parameters would be available through createParserFactory. Creating a parser from an existing JsonStructure is also a rather specialized use case.

Jitu

Jörn




[json-processing-spec users] [jsr353-experts] JsonBuilder and JsonReader as interfaces

Jörn Horstmann 12/02/2012

[json-processing-spec users] [jsr353-experts] Re: JsonBuilder and JsonReader as interfaces

Werner Keil 12/02/2012

[json-processing-spec users] [jsr353-experts] Re: JsonBuilder and JsonReader as interfaces

Jitendra Kotamraju 12/03/2012

[json-processing-spec users] [jsr353-experts] Re: JsonBuilder and JsonReader as interfaces

Jitendra Kotamraju 12/04/2012

[json-processing-spec users] [jsr353-experts] Re: JsonBuilder and JsonReader as interfaces

Jörn Horstmann 12/04/2012

[json-processing-spec users] Re: [jsr353-experts] Re: JsonBuilder and JsonReader as interfaces

Jitendra Kotamraju 12/05/2012

[json-processing-spec users] [jsr353-experts] Re: Re: JsonBuilder and JsonReader as interfaces

Jörn Horstmann 12/05/2012

[json-processing-spec users] Re: [jsr353-experts] Re: Re: JsonBuilder and JsonReader as interfaces

Jitendra Kotamraju 12/06/2012
 
 
Close
loading
Please Confirm
Close