All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.apicatalog.jsonld.json.JsonProvider Maven / Gradle / Ivy

There is a newer version: 1.4.1
Show newest version
package com.apicatalog.jsonld.json;

/**
 * Instead of using the Jakarta Json static class to create builders, it
 * is much faster to keep track of the provider in a static instance.  This
 * avoids the overhead of doing a service lookup on each call.  This improves
 * performance dramatically (about 200 to 300% for most calls).
 */
public class JsonProvider {

	private static jakarta.json.spi.JsonProvider provider;
	
	private JsonProvider() {}
	
	public static jakarta.json.spi.JsonProvider instance() {
		if (provider == null) {
			provider = jakarta.json.spi.JsonProvider.provider();
		}
		return provider;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy