Package org.apache.johnzon.mapper
Class Mapper
- java.lang.Object
-
- org.apache.johnzon.mapper.Mapper
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class Mapper extends Object implements Closeable
-
-
Field Summary
Fields Modifier and Type Field Description protected jakarta.json.JsonBuilderFactory
builderFactory
protected Charset
charset
protected Collection<Closeable>
closeables
protected MapperConfig
config
protected jakarta.json.stream.JsonGeneratorFactory
generatorFactory
protected Mappings
mappings
protected jakarta.json.spi.JsonProvider
provider
protected jakarta.json.JsonReaderFactory
readerFactory
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
jakarta.json.JsonBuilderFactory
getBuilderFactory()
jakarta.json.spi.JsonProvider
getProvider()
private Object
mapArray(Class<?> clazz, jakarta.json.JsonReader reader)
private <T> T
mapObject(Type clazz, jakarta.json.JsonReader reader)
<T> T[]
readArray(InputStream stream, Class<T> clazz)
<T> T[]
readArray(Reader stream, Class<T> clazz)
<T> Collection<T>
readCollection(jakarta.json.stream.JsonParser stream, ParameterizedType genericType)
<T> Collection<T>
readCollection(InputStream stream, ParameterizedType genericType)
<T> Collection<T>
readCollection(Reader stream, ParameterizedType genericType)
<T> T
readJohnzonCollection(InputStream stream, JohnzonCollectionType<T> genericType)
<T> T
readJohnzonCollection(Reader stream, JohnzonCollectionType<T> genericType)
jakarta.json.JsonArray
readJsonArray(jakarta.json.stream.JsonParser stream)
jakarta.json.JsonArray
readJsonArray(InputStream stream)
jakarta.json.JsonArray
readJsonArray(Reader stream)
<T> T
readObject(jakarta.json.JsonValue value, Type clazz)
<T> T
readObject(jakarta.json.stream.JsonParser stream, Type clazz)
<T> T
readObject(InputStream stream, Type clazz)
<T> T
readObject(Reader stream, Type clazz)
<T> T
readObject(String string, Type clazz)
<T> T
readTypedArray(jakarta.json.stream.JsonParser parser, Class<?> elementType, Class<T> arrayType)
<T> T
readTypedArray(InputStream stream, Class<?> elementType, Class<T> arrayType)
<T> T
readTypedArray(Reader stream, Class<?> elementType, Class<T> arrayType)
private InputStream
stream(InputStream stream)
private Reader
stream(Reader stream)
private Writer
stream(Writer stream)
jakarta.json.JsonValue
toStructure(Object object)
<T> void
writeArray(Object object, OutputStream stream)
<T> void
writeArray(Collection<T> object, OutputStream stream)
<T> void
writeArray(Collection<T> object, Writer stream)
<T> void
writeArray(T[] object, OutputStream stream)
<T> void
writeArray(T[] object, Writer stream)
String
writeArrayAsString(Collection<?> instance)
<T> String
writeArrayAsString(T[] instance)
<T> void
writeIterable(Iterable<T> object, OutputStream stream)
<T> void
writeIterable(Iterable<T> object, Writer stream)
private void
writeObject(Object object, jakarta.json.stream.JsonGenerator generator, Collection<String> ignored, JsonPointerTracker tracker)
void
writeObject(Object object, OutputStream stream)
void
writeObject(Object object, Writer stream)
String
writeObjectAsString(Object instance)
void
writeObjectWithGenerator(Object object, jakarta.json.stream.JsonGenerator generator)
-
-
-
Field Detail
-
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 Detail
-
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 Detail
-
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)
-
toStructure
public jakarta.json.JsonValue toStructure(Object object)
-
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)
-
readObject
public <T> T readObject(jakarta.json.JsonValue value, 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)
-
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)
-
mapObject
private <T> T mapObject(Type clazz, jakarta.json.JsonReader reader)
-
stream
private InputStream stream(InputStream stream)
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getBuilderFactory
public jakarta.json.JsonBuilderFactory getBuilderFactory()
-
getProvider
public jakarta.json.spi.JsonProvider getProvider()
-
-