javax.json.spi

Class JsonProvider


  • public abstract class JsonProvider
    extends Object
    Service provider for JSON processing objects.

    All the methods in this class are safe for use by multiple concurrent threads.

    Author:
    Jitendra Kotamraju
    See Also:
    ServiceLoader
    • Constructor Detail

      • JsonProvider

        protected JsonProvider()
    • Method Detail

      • provider

        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
        See Also:
        ServiceLoader
      • createParser

        public abstract JsonParser createParser(Reader reader)
        Creates a JSON parser from a character stream.
        Parameters:
        reader - i/o reader from which JSON is to be read
        Returns:
        a JSON parser
      • createParser

        public abstract JsonParser createParser(InputStream in)
        Creates a JSON parser from the specified byte stream. The character encoding of the stream is determined as defined in RFC 4627 .
        Parameters:
        in - i/o stream from which JSON is to be read
        Returns:
        a JSON parser
        Throws:
        JsonException - if encoding cannot be determined or i/o error (IOException would be cause of JsonException)
      • createParserFactory

        public abstract JsonParserFactory createParserFactory(Map<String,?> config)
        Creates a parser factory for creating JsonParser instances. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.
        Parameters:
        config - a map of provider specific properties to configure the JSON parsers. The map may be empty or null
        Returns:
        a JSON parser factory
      • createGenerator

        public abstract JsonGenerator createGenerator(Writer writer)
        Creates a JSON generator for writing JSON text to a character stream.
        Parameters:
        writer - a i/o writer to which JSON is written
        Returns:
        a JSON generator
      • createGenerator

        public abstract JsonGenerator createGenerator(OutputStream out)
        Creates a JSON generator for writing JSON text to a byte stream.
        Parameters:
        out - i/o stream to which JSON is written
        Returns:
        a JSON generator
      • createGeneratorFactory

        public abstract JsonGeneratorFactory createGeneratorFactory(Map<String,?> config)
        Creates a generator factory for creating JsonGenerator instances. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.
        Parameters:
        config - a map of provider specific properties to configure the JSON generators. The map may be empty or null
        Returns:
        a JSON generator factory
      • createReader

        public abstract JsonReader createReader(Reader reader)
        Creates a JSON reader from a character stream.
        Parameters:
        reader - a reader from which JSON is to be read
        Returns:
        a JSON reader
      • createReader

        public abstract JsonReader createReader(InputStream in)
        Creates a JSON reader from a byte stream. The character encoding of the stream is determined as described in RFC 4627.
        Parameters:
        in - a byte stream from which JSON is to be read
        Returns:
        a JSON reader
      • createWriter

        public abstract JsonWriter createWriter(Writer writer)
        Creates a JSON writer to write a JSON object or array structure to the specified character stream.
        Parameters:
        writer - to which JSON object or array is written
        Returns:
        a JSON writer
      • createWriter

        public abstract JsonWriter createWriter(OutputStream out)
        Creates a JSON writer to write a JSON object or array structure to the specified byte stream. Characters written to the stream are encoded into bytes using UTF-8 encoding.
        Parameters:
        out - to which JSON object or array is written
        Returns:
        a JSON writer
      • createWriterFactory

        public abstract JsonWriterFactory createWriterFactory(Map<String,?> config)
        Creates a writer factory for creating JsonWriter objects. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.
        Parameters:
        config - a map of provider specific properties to configure the JSON writers. The map may be empty or null
        Returns:
        a JSON writer factory
      • createReaderFactory

        public abstract JsonReaderFactory createReaderFactory(Map<String,?> config)
        Creates a reader factory for creating JsonReader objects. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.
        Parameters:
        config - a map of provider specific properties to configure the JSON readers. The map may be empty or null
        Returns:
        a JSON reader factory
      • createObjectBuilder

        public abstract JsonObjectBuilder createObjectBuilder()
        Creates a JSON object builder
        Returns:
        a JSON object builder
      • createArrayBuilder

        public abstract JsonArrayBuilder createArrayBuilder()
        Creates a JSON array builder
        Returns:
        a JSON array builder
      • createBuilderFactory

        public abstract JsonBuilderFactory createBuilderFactory(Map<String,?> config)
        Creates a builder factory for creating JsonArrayBuilder and JsonObjectBuilder objects. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.
        Parameters:
        config - a map of provider specific properties to configure the JSON builders. The map may be empty or null
        Returns:
        a JSON builder factory

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/json/spi/JsonProvider.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com, JsonProvider (Java(TM) EE 7 Specification APIs)

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.