java.lang.Object
org.apache.johnzon.mapper.Mapper
All Implemented Interfaces:
Closeable, AutoCloseable

public class Mapper extends Object implements Closeable
  • Field Details

    • config

      protected final MapperConfig config
    • mappings

      protected final Mappings mappings
    • readerFactory

      protected final jakarta.json.JsonReaderFactory readerFactory
    • generatorFactory

      protected final jakarta.json.stream.JsonGeneratorFactory generatorFactory
    • builderFactory

      protected final jakarta.json.JsonBuilderFactory builderFactory
    • provider

      protected final jakarta.json.spi.JsonProvider provider
    • closeables

      protected final Collection<Closeable> closeables
    • charset

      protected final Charset charset
  • Constructor Details

    • Mapper

      Mapper(jakarta.json.JsonReaderFactory readerFactory, jakarta.json.stream.JsonGeneratorFactory generatorFactory, jakarta.json.JsonBuilderFactory builderFactory, jakarta.json.spi.JsonProvider provider, MapperConfig config, Collection<Closeable> closeables)
  • Method Details

    • writeArray

      public <T> void writeArray(Object object, OutputStream stream)
    • writeArray

      public <T> void writeArray(T[] object, OutputStream stream)
    • writeArray

      public <T> void writeArray(T[] object, Writer stream)
    • writeArray

      public <T> void writeArray(Collection<T> object, OutputStream stream)
    • writeArray

      public <T> void writeArray(Collection<T> object, Writer stream)
    • writeIterable

      public <T> void writeIterable(Iterable<T> object, OutputStream stream)
    • writeIterable

      public <T> void writeIterable(Iterable<T> object, Writer stream)
    • toStructure

      public jakarta.json.JsonValue toStructure(Object object)
    • writeObject

      public void writeObject(Object object, Writer stream)
    • writeObjectWithGenerator

      public void writeObjectWithGenerator(Object object, jakarta.json.stream.JsonGenerator generator)
    • writeObject

      public void writeObject(Object object, OutputStream stream)
    • writeObject

      private void writeObject(Object object, jakarta.json.stream.JsonGenerator generator, Collection<String> ignored, JsonPointerTracker tracker)
    • writeArrayAsString

      public String writeArrayAsString(Collection<?> instance)
    • writeArrayAsString

      public <T> String writeArrayAsString(T[] instance)
    • writeObjectAsString

      public String writeObjectAsString(Object instance)
    • readObject

      public <T> T readObject(jakarta.json.JsonValue value, Type clazz)
    • readObject

      public <T> T readObject(String string, Type clazz)
    • readObject

      public <T> T readObject(Reader stream, Type clazz)
    • readObject

      public <T> T readObject(jakarta.json.stream.JsonParser stream, Type clazz)
    • readObject

      public <T> T readObject(InputStream stream, Type clazz)
    • readCollection

      public <T> Collection<T> readCollection(InputStream stream, ParameterizedType genericType)
    • readJohnzonCollection

      public <T> T readJohnzonCollection(InputStream stream, JohnzonCollectionType<T> genericType)
    • readJohnzonCollection

      public <T> T readJohnzonCollection(Reader stream, JohnzonCollectionType<T> genericType)
    • readCollection

      public <T> Collection<T> readCollection(Reader stream, ParameterizedType genericType)
    • readCollection

      public <T> Collection<T> readCollection(jakarta.json.stream.JsonParser stream, ParameterizedType genericType)
    • readArray

      public <T> T[] readArray(Reader stream, Class<T> clazz)
    • readTypedArray

      public <T> T readTypedArray(InputStream stream, Class<?> elementType, Class<T> arrayType)
    • readTypedArray

      public <T> T readTypedArray(Reader stream, Class<?> elementType, Class<T> arrayType)
    • readTypedArray

      public <T> T readTypedArray(jakarta.json.stream.JsonParser parser, Class<?> elementType, Class<T> arrayType)
    • readJsonArray

      public jakarta.json.JsonArray readJsonArray(Reader stream)
    • readJsonArray

      public jakarta.json.JsonArray readJsonArray(jakarta.json.stream.JsonParser stream)
    • readArray

      public <T> T[] readArray(InputStream stream, Class<T> clazz)
    • readJsonArray

      public jakarta.json.JsonArray readJsonArray(InputStream stream)
    • mapArray

      private Object mapArray(Class<?> clazz, jakarta.json.JsonReader reader)
    • mapObject

      private <T> T mapObject(Type clazz, jakarta.json.JsonReader reader)
    • stream

      private Reader stream(Reader stream)
    • stream

      private Writer stream(Writer stream)
    • stream

      private InputStream stream(InputStream stream)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getBuilderFactory

      public jakarta.json.JsonBuilderFactory getBuilderFactory()
    • getProvider

      public jakarta.json.spi.JsonProvider getProvider()