@Override public void serializeWithType(JsonGenerator jg, SerializerProvider provider, TypeSerializer typeSer) throws IOException, JsonProcessingException { typeSer.writeTypePrefixForArray(this, jg); if (_children != null) { for (JsonNode n : _children) { ((BaseJsonNode)n).writeTo(jg); } } typeSer.writeTypeSuffixForArray(this, jg); }
@Override public final void serialize(JsonGenerator jg, SerializerProvider provider) throws IOException, JsonProcessingException { jg.writeStartArray(); if (_children != null) { for (JsonNode n : _children) { /* 17-Feb-2009, tatu: Can we trust that all nodes will always * extend BaseJsonNode? Or if not, at least implement * JsonSerializable? Let's start with former, change if * we must. */ ((BaseJsonNode)n).writeTo(jg); } } jg.writeEndArray(); }