use of com.fasterxml.jackson.databind.JsonSerializable in project jackson-databind by FasterXML.
the class ArrayNode method serialize.
/*
/**********************************************************
/* Public API, serialization
/**********************************************************
*/
@Override
public void serialize(JsonGenerator f, SerializerProvider provider) throws IOException {
final List<JsonNode> c = _children;
final int size = c.size();
f.writeStartArray(size);
for (int i = 0; i < size; ++i) {
// we'll typically have array list
// For now, assuming it's either BaseJsonNode, JsonSerializable
JsonNode n = c.get(i);
if (n instanceof BaseJsonNode) {
((BaseJsonNode) n).serialize(f, provider);
} else {
((JsonSerializable) n).serialize(f, provider);
}
}
f.writeEndArray();
}
Aggregations