2

I am using the JSON JSR-353 api processor (jar javax.json-api-1.0.jar) to parse JSON files (using the streaming approach) and I added the JAR "javax.json-1.0.4.jar" that contains the default provider "org.glassfish.json.JsonProviderImpl" (without the second jar I had the exception "Provider org.glassfish.json.JsonProviderImpl not found" when the JsonParser is created "JsonParser parser = Json.createParser(json);")

My question is:

I need to work with the implementation of Jackson, so how can I set it as the Provider of the JSON JSR-353 API?

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
maher.belkh
  • 473
  • 2
  • 7
  • 21

1 Answers1

0

Use the classJsonProvider:

public static JsonProvider provider()

Creates a JSON provider object. The provider is loaded using the ServiceLoader.load(Class) method. If there are no available service providers, this method returns the default service provider.

Returns:
    a JSON provider

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265