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 classMappingParserImpl.SuppressConversionMappingParserInternal class to suppressObjectConverterlookup if and only if theJsonValueis the same refernece than the lookup was done before.
-
Field Summary
Fields Modifier and Type Field Description private static JohnzonParameterizedTypeANY_LISTprivate static CharacterConverterCHARACTER_CONVERTERprivate MapperConfigconfigprivate Map<String,Object>jsonPointersUsed for de-referencing JsonPointers during deserialisation.private jakarta.json.JsonReaderjsonReaderprivate Mappingsmappingsprotected 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 ObjectbuildArray(Type type, jakarta.json.JsonArray jsonArray, Adapter itemConverter, ObjectConverter.Reader objectConverter, JsonPointerTracker jsonPointer, Type rootType)private ObjectbuildArrayWithComponentType(jakarta.json.JsonArray jsonArray, Class<?> componentType, Adapter itemConverter, JsonPointerTracker jsonPointer, Type rootType)private ObjectbuildObject(Type inType, jakarta.json.JsonObject object, boolean applyObjectConverter, JsonPointerTracker jsonPointer, Collection<Class<?>> skippedConverters)private ObjectconvertTo(Type aClass, String text)Deprecated.see MapperConfigprivate ObjectconvertTo(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 AdapterfindAdapter(Type aClass)Deprecated.see MapperConfig - it is acually reversed so maybe not deprecated after all?private AdapterKeygetAdapterKey(Adapter converter)private booleanisDedup()private <T> Collection<T>mapCollection(Mappings.CollectionMapping mapping, jakarta.json.JsonArray jsonArray, Adapter itemConverter, ObjectConverter.Reader objectConverter, JsonPointerTracker jsonPointer, Type rootType)<T> TreadObject(jakarta.json.JsonValue jsonValue, Type targetType)<T> TreadObject(jakarta.json.JsonValue jsonValue, Type targetType, boolean applyObjectConverter, Collection<Class<?>> skippedConverters)<T> TreadObject(Type targetType)private NumbertoNumberValue(jakarta.json.JsonNumber jsonNumber)private ObjecttoObject(Object baseInstance, jakarta.json.JsonValue jsonValue, Type type, Adapter itemConverter, JsonPointerTracker jsonPointer, Type rootType)private ObjecttoValue(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:
readObjectin interfaceMappingParser
-
readObject
public <T> T readObject(jakarta.json.JsonValue jsonValue, Type targetType)- Specified by:
readObjectin 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)
-
-