public String toString() { try { StringWriter writer = new StringWriter(); JsonGenerator gen = Schema.FACTORY.createGenerator(writer); toJson(gen); gen.flush(); return writer.toString(); } catch (IOException e) { throw new AvroRuntimeException(e); } } void toJson(JsonGenerator gen) throws IOException {
public String toString() { try { StringWriter writer = new StringWriter(); JsonGenerator gen = Schema.FACTORY.createJsonGenerator(writer); toJson(gen); gen.flush(); return writer.toString(); } catch (IOException e) { throw new AvroRuntimeException(e); } } void toJson(JsonGenerator gen) throws IOException {
void toJson(JsonGenerator gen) throws IOException { types.space(namespace); gen.writeStartObject(); gen.writeStringField("protocol", name); gen.writeStringField("namespace", namespace); if (doc != null) gen.writeStringField("doc", doc); writeProps(gen); gen.writeArrayFieldStart("types"); Schema.Names resolved = new Schema.Names(namespace); for (Schema type : types.values()) if (!resolved.contains(type)) type.toJson(resolved, gen); gen.writeEndArray(); gen.writeObjectFieldStart("messages"); for (Map.Entry<String,Message> e : messages.entrySet()) { gen.writeFieldName(e.getKey()); e.getValue().toJson(gen); } gen.writeEndObject(); gen.writeEndObject(); }
void toJson(JsonGenerator gen) throws IOException { types.space(namespace); gen.writeStartObject(); gen.writeStringField("protocol", name); gen.writeStringField("namespace", namespace); if (doc != null) gen.writeStringField("doc", doc); writeProps(gen); gen.writeArrayFieldStart("types"); Schema.Names resolved = new Schema.Names(namespace); for (Schema type : types.values()) if (!resolved.contains(type)) type.toJson(resolved, gen); gen.writeEndArray(); gen.writeObjectFieldStart("messages"); for (Map.Entry<String,Message> e : messages.entrySet()) { gen.writeFieldName(e.getKey()); e.getValue().toJson(gen); } gen.writeEndObject(); gen.writeEndObject(); }
void toJson(JsonGenerator gen) throws IOException { types.space(namespace); gen.writeStartObject(); gen.writeStringField("protocol", name); gen.writeStringField("namespace", namespace); if (doc != null) gen.writeStringField("doc", doc); writeProps(gen); gen.writeArrayFieldStart("types"); Schema.Names resolved = new Schema.Names(namespace); for (Schema type : types.values()) if (!resolved.contains(type)) type.toJson(resolved, gen); gen.writeEndArray(); gen.writeObjectFieldStart("messages"); for (Map.Entry<String,Message> e : messages.entrySet()) { gen.writeFieldName(e.getKey()); e.getValue().toJson(gen); } gen.writeEndObject(); gen.writeEndObject(); }
void toJson(JsonGenerator gen) throws IOException { types.space(namespace); gen.writeStartObject(); gen.writeStringField("protocol", name); gen.writeStringField("namespace", namespace); gen.writeArrayFieldStart("types"); Schema.Names resolved = new Schema.Names(namespace); for (Schema type : types.values()) if (!resolved.contains(type)) type.toJson(resolved, gen); gen.writeEndArray(); gen.writeObjectFieldStart("messages"); for (Map.Entry<String,Message> e : messages.entrySet()) { gen.writeFieldName(e.getKey()); e.getValue().toJson(gen); } gen.writeEndObject(); gen.writeEndObject(); }
void toJson(JsonGenerator gen) throws IOException { types.space(namespace); gen.writeStartObject(); gen.writeStringField("protocol", name); gen.writeStringField("namespace", namespace); gen.writeArrayFieldStart("types"); Schema.Names resolved = new Schema.Names(namespace); for (Schema type : types.values()) if (!resolved.contains(type)) type.toJson(resolved, gen); gen.writeEndArray(); gen.writeObjectFieldStart("messages"); for (Map.Entry<String,Message> e : messages.entrySet()) { gen.writeFieldName(e.getKey()); e.getValue().toJson(gen); } gen.writeEndObject(); gen.writeEndObject(); }
public String toString() { try { StringWriter writer = new StringWriter(); JsonGenerator gen = Schema.FACTORY.createJsonGenerator(writer); toJson(gen); gen.flush(); return writer.toString(); } catch (IOException e) { throw new AvroRuntimeException(e); } } void toJson(JsonGenerator gen) throws IOException {
public String toString() { try { StringWriter writer = new StringWriter(); JsonGenerator gen = Schema.FACTORY.createJsonGenerator(writer); toJson(gen); gen.flush(); return writer.toString(); } catch (IOException e) { throw new AvroRuntimeException(e); } } void toJson(JsonGenerator gen) throws IOException {
public String toString() { try { StringWriter writer = new StringWriter(); JsonGenerator gen = Schema.FACTORY.createJsonGenerator(writer); toJson(gen); gen.flush(); return writer.toString(); } catch (IOException e) { throw new AvroRuntimeException(e); } } void toJson(JsonGenerator gen) throws IOException {
public String toString() { try { StringWriter writer = new StringWriter(); JsonGenerator gen = Schema.FACTORY.createJsonGenerator(writer); toJson(gen); gen.flush(); return writer.toString(); } catch (IOException e) { throw new AvroRuntimeException(e); } } void toJson(JsonGenerator gen) throws IOException {
void toJson(JsonGenerator gen) throws IOException { types.space(namespace); gen.writeStartObject(); gen.writeStringField("protocol", name); gen.writeStringField("namespace", namespace); if (doc != null) gen.writeStringField("doc", doc); writeProps(gen); gen.writeArrayFieldStart("types"); Schema.Names resolved = new Schema.Names(namespace); for (Schema type : types.values()) if (!resolved.contains(type)) type.toJson(resolved, gen); gen.writeEndArray(); gen.writeObjectFieldStart("messages"); for (Map.Entry<String,Message> e : messages.entrySet()) { gen.writeFieldName(e.getKey()); e.getValue().toJson(gen); } gen.writeEndObject(); gen.writeEndObject(); }