Refine search
@SuppressWarnings("resource") public Object processUnwrapped(JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered) throws IOException { for (int i = 0, len = _properties.size(); i < len; ++i) { SettableBeanProperty prop = _properties.get(i); JsonParser p = buffered.asParser(); p.nextToken(); prop.deserializeAndSet(p, ctxt, bean); } return bean; } }
protected final Object deserializeWithView(JsonParser p, DeserializationContext ctxt, Object bean, Class<?> activeView) throws IOException { if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME)) { String propName = p.getCurrentName(); do { p.nextToken(); // TODO: 06-Jan-2015, tatu: try streamlining call sequences here as well SettableBeanProperty prop = _beanProperties.find(propName); if (prop != null) { if (!prop.visibleInView(activeView)) { p.skipChildren(); continue; } try { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt); } continue; } handleUnknownVanilla(p, ctxt, bean, propName); } while ((propName = p.nextFieldName()) != null); } return bean; }
/** * Streamlined version that is only used when no "special" * features are enabled. */ private final Object vanillaDeserialize(JsonParser p, DeserializationContext ctxt, JsonToken t) throws IOException { final Object bean = _valueInstantiator.createUsingDefault(ctxt); // [databind#631]: Assign current value, to be accessible by custom serializers p.setCurrentValue(bean); if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME)) { String propName = p.getCurrentName(); do { p.nextToken(); SettableBeanProperty prop = _beanProperties.find(propName); if (prop != null) { // normal case try { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt); } continue; } handleUnknownVanilla(p, ctxt, bean, propName); } while ((propName = p.nextFieldName()) != null); } return bean; }
@SuppressWarnings("resource") protected final void _deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object bean, int index, String typeId) throws IOException { /* 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. */ JsonParser p2 = _tokens[index].asParser(p); JsonToken t = p2.nextToken(); // 29-Sep-2015, tatu: As per [databind#942], nulls need special support if (t == JsonToken.VALUE_NULL) { _properties[index].getProperty().set(bean, null); return; } TokenBuffer merged = new TokenBuffer(p, ctxt); merged.writeStartArray(); merged.writeString(typeId); merged.copyCurrentStructure(p2); merged.writeEndArray(); // needs to point to START_OBJECT (or whatever first token is) JsonParser mp = merged.asParser(p); mp.nextToken(); _properties[index].getProperty().deserializeAndSet(mp, ctxt, bean); }
final ExternalTypeHandler ext = _externalTypeIdHandler.start(); for (JsonToken t = p.getCurrentToken(); t == JsonToken.FIELD_NAME; t = p.nextToken()) { String propName = p.getCurrentName(); t = p.nextToken(); SettableBeanProperty prop = _beanProperties.find(propName); if (prop != null) { // normal case prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt);
final int propCount = props.length; while (true) { if (p.nextToken() == JsonToken.END_ARRAY) { return bean; if (prop != null) { // normal case try { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, prop.getName(), ctxt); } while (p.nextToken() != JsonToken.END_ARRAY); return bean;
t = p.nextToken(); for (; t == JsonToken.FIELD_NAME; t = p.nextToken()) { String propName = p.getCurrentName(); SettableBeanProperty prop = _beanProperties.find(propName); p.nextToken(); if (prop != null) { // normal case if (activeView != null && !prop.visibleInView(activeView)) { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt);
final int propCount = props.length; while (true) { if (p.nextToken() == JsonToken.END_ARRAY) { return bean; if (prop != null) { // normal case try { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, prop.getName(), ctxt); } while (p.nextToken() != JsonToken.END_ARRAY); return bean;
if (p.nextToken() == JsonToken.END_ARRAY) { return bean; if (activeView == null || prop.visibleInView(activeView)) { try { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, prop.getName(), ctxt); } while (p.nextToken() != JsonToken.END_ARRAY); return bean;
String propertyName = p.getCurrentName(); do { p.nextToken(); SettableBeanProperty property = _beanProperties.find(propertyName); property.deserializeAndSet(p, ctxt, bean);
int pendingIx = 0; for (; p.getCurrentToken() != JsonToken.END_OBJECT; p.nextToken()) { String propName = p.getCurrentName(); SettableBeanProperty prop = _beanProperties.find(propName); p.nextToken(); // to point to field value prop.deserializeAndSet(p, ctxt, throwable); continue;
p.nextToken(); SettableBeanProperty prop = _beanProperties.find(propName); prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt);
final Class<?> activeView = _needViewProcesing ? ctxt.getActiveView() : null; for (; p.nextToken() != JsonToken.END_ARRAY; ++i) { SettableBeanProperty prop = (i < propCount) ? props[i] : null; if (prop == null) { // we get null if there are extra elements; maybe otherwise too? prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, prop.getName(), ctxt);
String propName = p.getCurrentName(); do { p.nextToken(); SettableBeanProperty prop = _beanProperties.find(propName); if (prop != null) { // normal case try { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt);
p.nextToken(); SettableBeanProperty prop = _beanProperties.find(propName); if (prop != null) { // normal case prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt);
public Object processUnwrapped(JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered) throws IOException, JsonProcessingException { for (int i = 0, len = _properties.size(); i < len; ++i) { SettableBeanProperty prop = _properties.get(i); JsonParser jp = buffered.asParser(); jp.nextToken(); prop.deserializeAndSet(jp, ctxt, bean); } return bean; } }
public Object processUnwrapped(JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered) throws IOException, JsonProcessingException { for (int i = 0, len = _properties.size(); i < len; ++i) { SettableBeanProperty prop = _properties.get(i); JsonParser jp = buffered.asParser(); jp.nextToken(); prop.deserializeAndSet(jp, ctxt, bean); } return bean; } }
@SuppressWarnings("resource") public Object processUnwrapped(JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered) throws IOException { for (int i = 0, len = _properties.size(); i < len; ++i) { SettableBeanProperty prop = _properties.get(i); JsonParser p = buffered.asParser(); p.nextToken(); prop.deserializeAndSet(p, ctxt, bean); } return bean; } }
@SuppressWarnings("resource") public Object processUnwrapped(JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered) throws IOException, JsonProcessingException { for (int i = 0, len = _properties.size(); i < len; ++i) { SettableBeanProperty prop = _properties.get(i); JsonParser jp = buffered.asParser(); jp.nextToken(); prop.deserializeAndSet(jp, ctxt, bean); } return bean; } }
@SuppressWarnings("resource") public Object processUnwrapped(JsonParser originalParser, DeserializationContext ctxt, Object bean, TokenBuffer buffered) throws IOException { for (int i = 0, len = _properties.size(); i < len; ++i) { SettableBeanProperty prop = _properties.get(i); JsonParser p = buffered.asParser(); p.nextToken(); prop.deserializeAndSet(p, ctxt, bean); } return bean; } }