/** * Method called to start collection process by creating non-blueprint * instances. */ public ExternalTypeHandler start() { return new ExternalTypeHandler(this); }
private final boolean _handleTypePropertyValue(JsonParser p, DeserializationContext ctxt, String propName, Object bean, String typeId, int index) throws IOException { ExtTypedProperty prop = _properties[index]; if (!prop.hasTypePropertyName(propName)) { // when could/should this ever happen? return false; } // note: can NOT skip child values (should always be String anyway) boolean canDeserialize = (bean != null) && (_tokens[index] != null); // Minor optimization: deserialize properties as soon as we have all we need: if (canDeserialize) { _deserializeAndSet(p, ctxt, bean, index, typeId); // clear stored data, to avoid deserializing+setting twice: _tokens[index] = null; } else { _typeIds[index] = typeId; } return true; }
final ExternalTypeHandler ext = _externalTypeIdHandler.start(); ext.handleTypePropertyValue(p, ctxt, propName, bean); if (ext.handlePropertyValue(p, ctxt, propName, bean)) { continue; return ext.complete(p, ctxt, bean);
throws IOException final ExternalTypeHandler ext = _externalTypeIdHandler.start(); final PropertyBasedCreator creator = _propertyBasedCreator; PropertyValueBuffer buffer = creator.startBuilding(p, ctxt, _objectIdReader); if (ext.handlePropertyValue(p, ctxt, propName, null)) { _beanType, bean.getClass())); return ext.complete(p, ctxt, bean); if (ext.handlePropertyValue(p, ctxt, propName, null)) { continue; return ext.complete(p, ctxt, buffer, creator); } catch (Exception e) { return wrapInstantiationProblem(e, ctxt);
prop.getName(), _properties[i].getTypePropertyName()); values[i] = _deserialize(p, ctxt, i, typeId);
boolean result = false; for (Integer index : (List<Integer>) ob) { if (_handleTypePropertyValue(p, ctxt, propName, bean, typeId, index.intValue())) { result = true; return _handleTypePropertyValue(p, ctxt, propName, bean, typeId, ((Integer) ob).intValue());
if (typeDeser.getTypeInclusion() == JsonTypeInfo.As.EXTERNAL_PROPERTY) { if (extTypes == null) { extTypes = ExternalTypeHandler.builder(_beanType);
final ExternalTypeHandler ext = _externalTypeIdHandler.start(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { String propName = jp.getCurrentName(); if (ext.handlePropertyValue(jp, ctxt, propName, bean)) { continue; return ext.complete(jp, ctxt, bean);
throw ctxt.mappingException("Missing property '"+prop.getName()+"' for external type id '"+_properties[i].getTypePropertyName()); values[i] = _deserialize(jp, ctxt, i);
boolean result = false; for (Integer index : (List<Integer>) ob) { if (_handleTypePropertyValue(p, ctxt, propName, bean, typeId, index.intValue())) { result = true; return _handleTypePropertyValue(p, ctxt, propName, bean, typeId, ((Integer) ob).intValue());
if (typeDeser.getTypeInclusion() == JsonTypeInfo.As.EXTERNAL_PROPERTY) { if (extTypes == null) { extTypes = ExternalTypeHandler.builder(_beanType);
final ExternalTypeHandler ext = _externalTypeIdHandler.start(); ext.handleTypePropertyValue(p, ctxt, propName, bean); if (ext.handlePropertyValue(p, ctxt, propName, bean)) { continue; return ext.complete(p, ctxt, bean);
final ExternalTypeHandler ext = _externalTypeIdHandler.start(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { String propName = jp.getCurrentName(); if (ext.handlePropertyValue(jp, ctxt, propName, bean)) { continue; return ext.complete(jp, ctxt, bean);
_deserializeAndSet(p, ctxt, bean, index, typeId); _tokens[index] = null;
/** * Method called after all external properties have been assigned, to further * link property with polymorphic value with possible property for type id * itself. This is needed to support type ids as Creator properties. * * @since 2.8 */ public ExternalTypeHandler build(BeanPropertyMap otherProps) { // 21-Jun-2016, tatu: as per [databind#999], may need to link type id property also final int len = _properties.size(); ExtTypedProperty[] extProps = new ExtTypedProperty[len]; for (int i = 0; i < len; ++i) { ExtTypedProperty extProp = _properties.get(i); String typePropId = extProp.getTypePropertyName(); SettableBeanProperty typeProp = otherProps.find(typePropId); if (typeProp != null) { extProp.linkTypeProperty(typeProp); } extProps[i] = extProp; } return new ExternalTypeHandler(_beanType, extProps, _nameToPropertyIndex, null, null); } }
throw ctxt.mappingException("Missing property '"+prop.getName()+"' for external type id '"+_properties[i].getTypePropertyName()); values[i] = _deserialize(jp, ctxt, i);
final ExternalTypeHandler ext = _externalTypeIdHandler.start(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { String propName = jp.getCurrentName(); ext.handleTypePropertyValue(jp, ctxt, propName, bean); if (ext.handlePropertyValue(jp, ctxt, propName, bean)) { continue; return ext.complete(jp, ctxt, bean);
final ExternalTypeHandler ext = _externalTypeIdHandler.start(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { String propName = jp.getCurrentName(); if (ext.handlePropertyValue(jp, ctxt, propName, bean)) { continue; return ext.complete(jp, ctxt, bean);
_deserializeAndSet(p, ctxt, bean, i, typeId);
/** * Method called to start collection process by creating non-blueprint * instances. */ public ExternalTypeHandler start() { return new ExternalTypeHandler(this); }