@SuppressWarnings("unchecked") @Override void addValue(Object val) { if (_wrapped == null) { if (val instanceof List) { _wrapped = new ArrayContext((List<Object>) (col = val)); } else if (val instanceof Map) { _wrapped = new ObjectContext((Map<Object, Object>) (col = val)); } else if (val instanceof String) { _wrapped = new StringContext((String) (col = val)); } else { throw new RuntimeException("expected list or map but found: " + (val == null ? null : val.getClass().getName())); } } else { _wrapped.addValue(val); } } }
switch (c) { case '[': ctx.addValue(_parse(new ArrayContext(new ArrayList<Object>()))); break; ctx.addValue(_parse(new ObjectContext(new LinkedHashMap<Object, Object>()))); break; return ctx.record(); ctx.record(); break; case '\'': if (c == term) { ctx.addValue(appender.toString()); term = 0; break StrCapture; if (isNumberStart(c)) { carry = c; ctx.addValue(parseDouble()); break; if (s.length() > 5) ctx.addValue(s); else if ("null".equals(s)) { ctx.addValue(null); ctx.addValue(Boolean.TRUE);
switch (c) { case '[': ctx.addValue(_parse(new ArrayContext(new ArrayList<Object>()))); break; ctx.addValue(_parse(new ObjectContext(new LinkedHashMap<Object, Object>()))); break; return ctx.record(); ctx.record(); break; case '\'': if (c == term) { ctx.addValue(appender.toString()); term = 0; break StrCapture; if (isNumberStart(c)) { carry = c; ctx.addValue(parseDouble()); break; if (s.length() > 5) ctx.addValue(s); else if ("null".equals(s)) { ctx.addValue(null); ctx.addValue(Boolean.TRUE);
@SuppressWarnings("unchecked") @Override void addValue(Object val) { if (_wrapped == null) { if (val instanceof List) { _wrapped = new ArrayContext((List<Object>) (col = val)); } else if (val instanceof Map) { _wrapped = new ObjectContext((Map<Object, Object>) (col = val)); } else if (val instanceof String) { _wrapped = new StringContext((String) (col = val)); } else { throw new RuntimeException("expected list or map but found: " + (val == null ? null : val.getClass().getName())); } } else { _wrapped.addValue(val); } } }