public void addExternal(SettableBeanProperty property, String extPropName) { Integer index = _properties.size(); _properties.add(new ExtTypedProperty(property, extPropName)); _nameToPropertyIndex.put(property.getName(), index); _nameToPropertyIndex.put(extPropName, index); }
ExtTypedProperty prop = _properties[index]; boolean canDeserialize; if (prop.hasTypePropertyName(propName)) { _typeIds[index] = jp.getText(); jp.skipChildren();
ExtTypedProperty prop = _properties[index]; boolean canDeserialize; if (prop.hasTypePropertyName(propName)) { _typeIds[index] = jp.getText(); jp.skipChildren();
ExtTypedProperty prop = _properties[index]; boolean canDeserialize; if (prop.hasTypePropertyName(propName)) { _typeIds[index] = jp.getText(); jp.skipChildren();
if (!prop.hasTypePropertyName(propName)) { return false;
public Object complete(JsonParser jp, DeserializationContext ctxt, Object bean) throws IOException, JsonProcessingException { for (int i = 0, len = _properties.length; i < len; ++i) { if (_typeIds[i] == null) { // let's allow missing both type and property (may already have been set, too) if (_tokens[i] == null) { continue; } // but not just one throw ctxt.mappingException("Missing external type id property '"+_properties[i].getTypePropertyName()); } else if (_tokens[i] == null) { SettableBeanProperty prop = _properties[i].getProperty(); throw ctxt.mappingException("Missing property '"+prop.getName()+"' for external type id '"+_properties[i].getTypePropertyName()); } _deserialize(jp, ctxt, bean, i); } return bean; }
protected final void _deserialize(JsonParser jp, DeserializationContext ctxt, Object bean, int index) throws IOException, JsonProcessingException { /* Ok: time to mix type id, value; and we will actually use "wrapper-array" * style to ensure we can handle all kinds of JSON constructs. */ TokenBuffer merged = new TokenBuffer(jp.getCodec()); merged.writeStartArray(); merged.writeString(_typeIds[index]); JsonParser p2 = _tokens[index].asParser(jp); p2.nextToken(); merged.copyCurrentStructure(p2); merged.writeEndArray(); // needs to point to START_OBJECT (or whatever first token is) p2 = merged.asParser(jp); p2.nextToken(); _properties[index].getProperty().deserializeAndSet(p2, ctxt, bean); }
public Object complete(JsonParser jp, DeserializationContext ctxt, Object bean) throws IOException, JsonProcessingException { for (int i = 0, len = _properties.length; i < len; ++i) { if (_typeIds[i] == null) { // let's allow missing both type and property (may already have been set, too) if (_tokens[i] == null) { continue; } // but not just one throw ctxt.mappingException("Missing external type id property '"+_properties[i].getTypePropertyName()+"'"); } else if (_tokens[i] == null) { SettableBeanProperty prop = _properties[i].getProperty(); throw ctxt.mappingException("Missing property '"+prop.getName()+"' for external type id '"+_properties[i].getTypePropertyName()); } _deserialize(jp, ctxt, bean, i); } return bean; }
protected final void _deserialize(JsonParser jp, DeserializationContext ctxt, Object bean, int index) throws IOException, JsonProcessingException { /* Ok: time to mix type id, value; and we will actually use "wrapper-array" * style to ensure we can handle all kinds of JSON constructs. */ TokenBuffer merged = new TokenBuffer(jp.getCodec()); merged.writeStartArray(); merged.writeString(_typeIds[index]); JsonParser p2 = _tokens[index].asParser(jp); p2.nextToken(); merged.copyCurrentStructure(p2); merged.writeEndArray(); // needs to point to START_OBJECT (or whatever first token is) p2 = merged.asParser(jp); p2.nextToken(); _properties[index].getProperty().deserializeAndSet(p2, ctxt, bean); }
public void addExternal(SettableBeanProperty property, String extPropName) { Integer index = _properties.size(); _properties.add(new ExtTypedProperty(property, extPropName)); _nameToPropertyIndex.put(property.getName(), index); _nameToPropertyIndex.put(extPropName, index); }
public void addExternal(SettableBeanProperty property, String extPropName) { Integer index = _properties.size(); _properties.add(new ExtTypedProperty(property, extPropName)); _nameToPropertyIndex.put(property.getName(), index); _nameToPropertyIndex.put(extPropName, index); }
if (!prop.hasTypePropertyName(propName)) { return false;
ExtTypedProperty prop = _properties[index]; boolean canDeserialize; if (prop.hasTypePropertyName(propName)) { _typeIds[index] = jp.getText(); jp.skipChildren();
protected final void _deserialize(JsonParser jp, DeserializationContext ctxt, Object bean, int index) throws IOException, JsonProcessingException { /* Ok: time to mix type id, value; and we will actually use "wrapper-array" * style to ensure we can handle all kinds of JSON constructs. */ TokenBuffer merged = new TokenBuffer(jp.getCodec()); merged.writeStartArray(); merged.writeString(_typeIds[index]); JsonParser p2 = _tokens[index].asParser(jp); p2.nextToken(); merged.copyCurrentStructure(p2); merged.writeEndArray(); // needs to point to START_OBJECT (or whatever first token is) p2 = merged.asParser(jp); p2.nextToken(); _properties[index].getProperty().deserializeAndSet(p2, ctxt, bean); }
public Object complete(JsonParser jp, DeserializationContext ctxt, Object bean) throws IOException, JsonProcessingException { for (int i = 0, len = _properties.length; i < len; ++i) { if (_typeIds[i] == null) { // let's allow missing both type and property (may already have been set, too) if (_tokens[i] == null) { continue; } // but not just one throw ctxt.mappingException("Missing external type id property '"+_properties[i].getTypePropertyName()+"'"); } else if (_tokens[i] == null) { SettableBeanProperty prop = _properties[i].getProperty(); throw ctxt.mappingException("Missing property '"+prop.getName()+"' for external type id '"+_properties[i].getTypePropertyName()); } _deserialize(jp, ctxt, bean, i); } return bean; }
public void addExternal(SettableBeanProperty property, String extPropName) { Integer index = _properties.size(); _properties.add(new ExtTypedProperty(property, extPropName)); _nameToPropertyIndex.put(property.getName(), index); _nameToPropertyIndex.put(extPropName, index); }
if (!prop.hasTypePropertyName(propName)) { return false;
public Object complete(JsonParser jp, DeserializationContext ctxt, Object bean) throws IOException, JsonProcessingException { for (int i = 0, len = _properties.length; i < len; ++i) { if (_typeIds[i] == null) { // let's allow missing both type and property (may already have been set, too) if (_tokens[i] == null) { continue; } // but not just one throw ctxt.mappingException("Missing external type id property '"+_properties[i].getTypePropertyName()+"'"); } else if (_tokens[i] == null) { SettableBeanProperty prop = _properties[i].getProperty(); throw ctxt.mappingException("Missing property '"+prop.getName()+"' for external type id '"+_properties[i].getTypePropertyName()); } _deserialize(jp, ctxt, bean, i); } return bean; }
protected final void _deserialize(JsonParser jp, DeserializationContext ctxt, Object bean, int index) throws IOException, JsonProcessingException { /* Ok: time to mix type id, value; and we will actually use "wrapper-array" * style to ensure we can handle all kinds of JSON constructs. */ TokenBuffer merged = new TokenBuffer(jp.getCodec()); merged.writeStartArray(); merged.writeString(_typeIds[index]); JsonParser p2 = _tokens[index].asParser(jp); p2.nextToken(); merged.copyCurrentStructure(p2); merged.writeEndArray(); // needs to point to START_OBJECT (or whatever first token is) p2 = merged.asParser(jp); p2.nextToken(); _properties[index].getProperty().deserializeAndSet(p2, ctxt, bean); }