public ReadOnlyClassToSerializerMap instance() { return new ReadOnlyClassToSerializerMap(_map); }
/** * Method that can be called to get a read-only instance populated from the * most recent version of the shared lookup Map. */ public ReadOnlyClassToSerializerMap getReadOnlyLookupMap() { ReadOnlyClassToSerializerMap m; synchronized (this) { m = _readOnlyMap; if (m == null) { _readOnlyMap = m = ReadOnlyClassToSerializerMap.from(_sharedMap); } } return m.instance(); }
@Override public JsonSerializer<Object> findTypedValueSerializer(JavaType valueType, boolean cache, BeanProperty property) throws JsonMappingException { // Two-phase lookups; local non-shared cache, then shared: JsonSerializer<Object> ser = _knownSerializers.typedValueSerializer(valueType); if (ser != null) { return ser; } // If not, maybe shared map already has it? ser = _serializerCache.typedValueSerializer(valueType); if (ser != null) { return ser; } // Well, let's just compose from pieces: ser = findValueSerializer(valueType, property); TypeSerializer typeSer = _serializerFactory.createTypeSerializer(_config, valueType, property); if (typeSer != null) { ser = new WrappedSerializer(typeSer, ser); } if (cache) { _serializerCache.addTypedSerializer(valueType, ser); } return ser; }
/** * Method that will try to find a serializer, either from cache * or by constructing one; but will not return an "unknown" serializer * if this can not be done but rather returns null. * * @return Serializer if one can be found, null if not. */ protected JsonSerializer<Object> _findExplicitUntypedSerializer(Class<?> runtimeType, BeanProperty property) { // Fast lookup from local lookup thingy works? JsonSerializer<Object> ser = _knownSerializers.untypedValueSerializer(runtimeType); if (ser != null) { return ser; } // If not, maybe shared map already has it? ser = _serializerCache.untypedValueSerializer(runtimeType); if (ser != null) { return ser; } try { return _createAndCacheUntypedSerializer(runtimeType, property); } catch (Exception e) { return null; } }
JsonSerializer<Object> ser = _knownSerializers.untypedValueSerializer(valueType); if (ser == null) {
/** * Method that can be called to get a read-only instance populated from the * most recent version of the shared lookup Map. */ public ReadOnlyClassToSerializerMap getReadOnlyLookupMap() { ReadOnlyClassToSerializerMap m; synchronized (this) { m = _readOnlyMap; if (m == null) { _readOnlyMap = m = ReadOnlyClassToSerializerMap.from(_sharedMap); } } return m.instance(); }
JsonSerializer<Object> ser = _knownSerializers.untypedValueSerializer(valueType); if (ser == null) {
/** * Factory method for creating the "blueprint" lookup map. Such map * can not be used as is but just shared: to get an actual usable * instance, {@link #instance} has to be called first. */ public static ReadOnlyClassToSerializerMap from(HashMap<TypeKey, JsonSerializer<Object>> src) { return new ReadOnlyClassToSerializerMap(new JsonSerializerMap(src)); }
JsonSerializer<Object> ser = _knownSerializers.typedValueSerializer(valueType); if (ser != null) { return ser;
/** * Method that can be called to get a read-only instance populated from the * most recent version of the shared lookup Map. */ public ReadOnlyClassToSerializerMap getReadOnlyLookupMap() { ReadOnlyClassToSerializerMap m; synchronized (this) { m = _readOnlyMap; if (m == null) { _readOnlyMap = m = ReadOnlyClassToSerializerMap.from(_sharedMap); } } return m.instance(); }
/** * Method that will try to find a serializer, either from cache * or by constructing one; but will not return an "unknown" serializer * if this can not be done but rather returns null. * * @return Serializer if one can be found, null if not. */ protected JsonSerializer<Object> _findExplicitUntypedSerializer(Class<?> runtimeType, BeanProperty property) { // Fast lookup from local lookup thingy works? JsonSerializer<Object> ser = _knownSerializers.untypedValueSerializer(runtimeType); if (ser != null) { return ser; } // If not, maybe shared map already has it? ser = _serializerCache.untypedValueSerializer(runtimeType); if (ser != null) { return ser; } try { return _createAndCacheUntypedSerializer(runtimeType, property); } catch (Exception e) { return null; } }
public ReadOnlyClassToSerializerMap instance() { return new ReadOnlyClassToSerializerMap(_map); }
@Override public JsonSerializer<Object> findTypedValueSerializer(JavaType valueType, boolean cache, BeanProperty property) throws JsonMappingException { // Two-phase lookups; local non-shared cache, then shared: JsonSerializer<Object> ser = _knownSerializers.typedValueSerializer(valueType); if (ser != null) { return ser; } // If not, maybe shared map already has it? ser = _serializerCache.typedValueSerializer(valueType); if (ser != null) { return ser; } // Well, let's just compose from pieces: ser = findValueSerializer(valueType, property); TypeSerializer typeSer = _serializerFactory.createTypeSerializer(_config, valueType, property); if (typeSer != null) { ser = new WrappedSerializer(typeSer, ser); } if (cache) { _serializerCache.addTypedSerializer(valueType, ser); } return ser; }
/** * Method that can be called to get a read-only instance populated from the * most recent version of the shared lookup Map. */ public ReadOnlyClassToSerializerMap getReadOnlyLookupMap() { ReadOnlyClassToSerializerMap m; synchronized (this) { m = _readOnlyMap; if (m == null) { _readOnlyMap = m = ReadOnlyClassToSerializerMap.from(_sharedMap); } } return m.instance(); }
JsonSerializer<Object> ser = _knownSerializers.untypedValueSerializer(valueType); if (ser == null) {
/** * Factory method for creating the "blueprint" lookup map. Such map * can not be used as is but just shared: to get an actual usable * instance, {@link #instance} has to be called first. */ public static ReadOnlyClassToSerializerMap from(HashMap<TypeKey, JsonSerializer<Object>> src) { return new ReadOnlyClassToSerializerMap(new JsonSerializerMap(src)); }
JsonSerializer<Object> ser = _knownSerializers.typedValueSerializer(valueType); if (ser != null) { return ser;
/** * Method that can be called to get a read-only instance populated from the * most recent version of the shared lookup Map. */ public ReadOnlyClassToSerializerMap getReadOnlyLookupMap() { ReadOnlyClassToSerializerMap m; synchronized (this) { m = _readOnlyMap; if (m == null) { _readOnlyMap = m = ReadOnlyClassToSerializerMap.from(_sharedMap); } } return m.instance(); }
JsonSerializer<Object> ser = _knownSerializers.untypedValueSerializer(valueType); if (ser == null) {
public ReadOnlyClassToSerializerMap instance() { return new ReadOnlyClassToSerializerMap(_map); }