@Override public JsonStreamContext getParsingContext() { return delegate.getParsingContext(); } @Override public boolean isExpectedStartArrayToken() { return delegate.isExpectedStartArrayToken(); }
@Override public TokenStreamContext getParsingContext() { return delegate.getParsingContext(); } @Override public boolean isExpectedStartArrayToken() { return delegate.isExpectedStartArrayToken(); }
@Override public boolean inArray() { return input.getParsingContext().inArray(); }
/** * Helper method, usually equivalent to: *<code> * getParsingContext().setCurrentValue(v); *</code> * * @since 2.5 */ public void setCurrentValue(Object v) { JsonStreamContext ctxt = getParsingContext(); if (ctxt != null) { ctxt.setCurrentValue(v); } }
/** * Helper method, usually equivalent to: *<code> * getParsingContext().getCurrentValue(); *</code> *<p> * Note that "current value" is NOT populated (or used) by Streaming parser; * it is only used by higher-level data-binding functionality. * The reason it is included here is that it can be stored and accessed hierarchically, * and gets passed through data-binding. * * @since 2.5 */ public Object getCurrentValue() { JsonStreamContext ctxt = getParsingContext(); return (ctxt == null) ? null : ctxt.getCurrentValue(); }
@Override public String getPath() { return toJsonPath(parser.getParsingContext()); }
/** * Helper method, usually equivalent to: *<code> * getParsingContext().setCurrentValue(v); *</code> */ public void setCurrentValue(Object v) { TokenStreamContext ctxt = getParsingContext(); if (ctxt != null) { ctxt.setCurrentValue(v); } }
protected void _resync() throws IOException { final JsonParser p = _parser; // First, a quick check to see if we might have been lucky and no re-sync needed if (p.getParsingContext() == _seqContext) { return; } while (true) { JsonToken t = p.nextToken(); if ((t == JsonToken.END_ARRAY) || (t == JsonToken.END_OBJECT)) { if (p.getParsingContext() == _seqContext) { p.clearCurrentToken(); return; } } else if ((t == JsonToken.START_ARRAY) || (t == JsonToken.START_OBJECT)) { p.skipChildren(); } else if (t == null) { return; } } }
/** * Helper method, usually equivalent to: *<code> * getParsingContext().getCurrentValue(); *</code> *<p> * Note that "current value" is NOT populated (or used) by Streaming parser; * it is only used by higher-level data-binding functionality. * The reason it is included here is that it can be stored and accessed hierarchically, * and gets passed through data-binding. */ public Object getCurrentValue() { TokenStreamContext ctxt = getParsingContext(); return (ctxt == null) ? null : ctxt.getCurrentValue(); }
@Override public boolean inArray() { return input.getParsingContext().inArray(); }
/** * @since 2.7 */ public TokenBuffer(JsonParser p, DeserializationContext ctxt) { _objectCodec = p.getCodec(); _parentContext = p.getParsingContext(); _generatorFeatures = DEFAULT_GENERATOR_FEATURES; _writeContext = JsonWriteContext.createRootContext(null); // at first we have just one segment _first = _last = new Segment(); _appendAt = 0; _hasNativeTypeIds = p.canReadTypeId(); _hasNativeObjectIds = p.canReadObjectId(); _mayHaveNativeIds = _hasNativeTypeIds | _hasNativeObjectIds; _forceBigDecimal = (ctxt == null) ? false : ctxt.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS); }
_state = STATE_CLOSED; } else { JsonStreamContext sctxt = p.getParsingContext(); if (managedParser && p.isExpectedStartArrayToken()) {
@Override protected Object deserializeFromObjectUsingNonDefault(JsonParser p, DeserializationContext ctxt) throws IOException { JsonStreamContext parent = p.getParsingContext().getParent();
@Override public JsonStreamContext getParsingContext() { return delegate.getParsingContext(); }
/** * Helper method, usually equivalent to: *<code> * getParsingContext().getCurrentValue(); *</code> * * @since 2.5 */ public Object getCurrentValue() { JsonStreamContext ctxt = getParsingContext(); return (ctxt == null) ? null : ctxt.getCurrentValue(); }
@Override public String getPath() { return toJsonPath(parser.getParsingContext()); }
/** * Helper method, usually equivalent to: *<code> * getParsingContext().getCurrentValue(); *</code> * * @since 2.5 */ public Object getCurrentValue() { JsonStreamContext ctxt = getParsingContext(); return (ctxt == null) ? null : ctxt.getCurrentValue(); }
@Override public Object findInjectableValue(Object valueId, DeserializationContext ctxt, BeanProperty forProperty, Object beanInstance) throws JsonMappingException { if(valueId != null && CURRENT_NAME.equals(valueId)){ return ctxt.getParser().getParsingContext().getCurrentName(); } return delegate.findInjectableValue(valueId, ctxt, forProperty, beanInstance); }
public ParseResults parse(JsonParser parser) throws BagriException { logger.trace("parse.enter; context: {}; schema: {}", parser.getParsingContext(), parser.getSchema()); ParserContext ctx = initContext(); try { while (parser.nextToken() != null) { processToken(ctx, parser); } } catch (IOException ex) { throw new BagriException(ex, BagriException.ecInOut); } return ctx.getParseResults(); }
private static String getContainingField(JsonParser parser) { final JsonStreamContext ctx = parser.getParsingContext(); if (ctx.inArray()) { return ctx.getParent().getCurrentName(); } else { return ctx.getCurrentName(); } } }