Package org.apache.johnzon.mapper
Class MappingParserImpl
- java.lang.Object
-
- org.apache.johnzon.mapper.MappingParserImpl
-
- All Implemented Interfaces:
MappingParser
public class MappingParserImpl extends Object implements MappingParser
This class is not concurrently usable as it contains state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MappingParserImpl.SuppressConversionMappingParser
Internal class to suppressObjectConverter
lookup if and only if theJsonValue
is the same refernece than the lookup was done before.
-
Field Summary
Fields Modifier and Type Field Description private static JohnzonParameterizedType
ANY_LIST
private static CharacterConverter
CHARACTER_CONVERTER
private MapperConfig
config
private Map<String,Object>
jsonPointers
Used for de-referencing JsonPointers during deserialisation.private jakarta.json.JsonReader
jsonReader
private Mappings
mappings
protected ConcurrentMap<Class<?>,Method>
valueOfs
-
Constructor Summary
Constructors Constructor Description MappingParserImpl(MapperConfig config, Mappings mappings, jakarta.json.JsonReader jsonReader, Map<String,Object> jsonPointers)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private Object
buildArray(Type type, jakarta.json.JsonArray jsonArray, Adapter itemConverter, ObjectConverter.Reader objectConverter, JsonPointerTracker jsonPointer, Type rootType)
private Object
buildArrayWithComponentType(jakarta.json.JsonArray jsonArray, Class<?> componentType, Adapter itemConverter, JsonPointerTracker jsonPointer, Type rootType)
private Object
buildObject(Type inType, jakarta.json.JsonObject object, boolean applyObjectConverter, JsonPointerTracker jsonPointer, Collection<Class<?>> skippedConverters)
private Object
convertTo(Type aClass, String text)
Deprecated.see MapperConfigprivate Object
convertTo(Adapter converter, jakarta.json.JsonValue jsonValue, JsonPointerTracker jsonPointer, Type targetType)
private Object[]
createParameters(Mappings.ClassMapping mapping, jakarta.json.JsonObject object, JsonPointerTracker jsonPointer, Function<Exception,RuntimeException> onException)
private Adapter
findAdapter(Type aClass)
Deprecated.see MapperConfig - it is acually reversed so maybe not deprecated after all?private AdapterKey
getAdapterKey(Adapter converter)
private boolean
isDedup()
private <T> Collection<T>
mapCollection(Mappings.CollectionMapping mapping, jakarta.json.JsonArray jsonArray, Adapter itemConverter, ObjectConverter.Reader objectConverter, JsonPointerTracker jsonPointer, Type rootType)
<T> T
readObject(jakarta.json.JsonValue jsonValue, Type targetType)
<T> T
readObject(jakarta.json.JsonValue jsonValue, Type targetType, boolean applyObjectConverter, Collection<Class<?>> skippedConverters)
<T> T
readObject(Type targetType)
private Number
toNumberValue(jakarta.json.JsonNumber jsonNumber)
private Object
toObject(Object baseInstance, jakarta.json.JsonValue jsonValue, Type type, Adapter itemConverter, JsonPointerTracker jsonPointer, Type rootType)
private Object
toValue(Object baseInstance, jakarta.json.JsonValue jsonValue, Adapter converter, Adapter itemConverter, Type type, ObjectConverter.Reader objectConverter, JsonPointerTracker jsonPointer, Type rootType, Function<Exception,RuntimeException> onException)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.johnzon.mapper.MappingParser
getSkippedConverters
-
-
-
-
Field Detail
-
ANY_LIST
private static final JohnzonParameterizedType ANY_LIST
-
CHARACTER_CONVERTER
private static final CharacterConverter CHARACTER_CONVERTER
-
valueOfs
protected final ConcurrentMap<Class<?>,Method> valueOfs
-
config
private final MapperConfig config
-
mappings
private final Mappings mappings
-
jsonReader
private final jakarta.json.JsonReader jsonReader
-
-
Constructor Detail
-
MappingParserImpl
public MappingParserImpl(MapperConfig config, Mappings mappings, jakarta.json.JsonReader jsonReader, Map<String,Object> jsonPointers)
-
-
Method Detail
-
readObject
public <T> T readObject(Type targetType)
- Specified by:
readObject
in interfaceMappingParser
-
readObject
public <T> T readObject(jakarta.json.JsonValue jsonValue, Type targetType)
- Specified by:
readObject
in interfaceMappingParser
-
readObject
public <T> T readObject(jakarta.json.JsonValue jsonValue, Type targetType, boolean applyObjectConverter, Collection<Class<?>> skippedConverters)
-
isDedup
private boolean isDedup()
-
buildObject
private Object buildObject(Type inType, jakarta.json.JsonObject object, boolean applyObjectConverter, JsonPointerTracker jsonPointer, Collection<Class<?>> skippedConverters)
-
toNumberValue
private Number toNumberValue(jakarta.json.JsonNumber jsonNumber)
-
convertTo
private Object convertTo(Adapter converter, jakarta.json.JsonValue jsonValue, JsonPointerTracker jsonPointer, Type targetType)
-
getAdapterKey
private AdapterKey getAdapterKey(Adapter converter)
-
toObject
private Object toObject(Object baseInstance, jakarta.json.JsonValue jsonValue, Type type, Adapter itemConverter, JsonPointerTracker jsonPointer, Type rootType)
-
buildArray
private Object buildArray(Type type, jakarta.json.JsonArray jsonArray, Adapter itemConverter, ObjectConverter.Reader objectConverter, JsonPointerTracker jsonPointer, Type rootType)
-
buildArrayWithComponentType
private Object buildArrayWithComponentType(jakarta.json.JsonArray jsonArray, Class<?> componentType, Adapter itemConverter, JsonPointerTracker jsonPointer, Type rootType)
-
mapCollection
private <T> Collection<T> mapCollection(Mappings.CollectionMapping mapping, jakarta.json.JsonArray jsonArray, Adapter itemConverter, ObjectConverter.Reader objectConverter, JsonPointerTracker jsonPointer, Type rootType)
-
createParameters
private Object[] createParameters(Mappings.ClassMapping mapping, jakarta.json.JsonObject object, JsonPointerTracker jsonPointer, Function<Exception,RuntimeException> onException)
-
toValue
private Object toValue(Object baseInstance, jakarta.json.JsonValue jsonValue, Adapter converter, Adapter itemConverter, Type type, ObjectConverter.Reader objectConverter, JsonPointerTracker jsonPointer, Type rootType, Function<Exception,RuntimeException> onException)
-
-