public void writeStartObject(JsonGenerator jg) throws IOException, JsonGenerationException { jg.writeRaw('{'); }
public void writeRootValueSeparator(JsonGenerator jg) throws IOException, JsonGenerationException { jg.writeRaw(' '); }
public void writeIndentation(JsonGenerator jg, int level) throws IOException, JsonGenerationException { jg.writeRaw(' '); }
public void writeEndObject(JsonGenerator jg, int nrOfEntries) throws IOException, JsonGenerationException { jg.writeRaw('}'); }
public void writeEndArray(JsonGenerator jg, int nrOfValues) throws IOException, JsonGenerationException { jg.writeRaw(']'); } }
public void writeRootValueSeparator(JsonGenerator jg) throws IOException, JsonGenerationException { if (_rootValueSeparator != null) { jg.writeRaw(_rootValueSeparator); } }
public void writeStartArray(JsonGenerator jg) throws IOException, JsonGenerationException { jg.writeRaw('['); }
@Override public void writeRaw(String text, int offset, int len) throws IOException, JsonGenerationException { delegate.writeRaw(text, offset, len); }
@Override public void writeRaw(char c) throws IOException, JsonGenerationException { delegate.writeRaw(c); }
@Override public void writeRaw(char[] text, int offset, int len) throws IOException, JsonGenerationException { delegate.writeRaw(text, offset, len); }
/** * Method called after an object field has been output, but * before the value is output. *<p> * Default handling will just output a single * colon to separate the two, without additional spaces. */ //@Override public void writeObjectFieldValueSeparator(JsonGenerator jg) throws IOException, JsonGenerationException { jg.writeRaw(':'); }
@Override public void writeRaw(String text) throws IOException, JsonGenerationException { delegate.writeRaw(text); }
public void writeStartArray(JsonGenerator jg) throws IOException, JsonGenerationException { if (!_arrayIndenter.isInline()) { ++_nesting; } jg.writeRaw('['); }
public void writeStartObject(JsonGenerator jg) throws IOException, JsonGenerationException { jg.writeRaw('{'); if (!_objectIndenter.isInline()) { ++_nesting; } }
@Override public Generator writeRaw(String value) { try { generator.writeRaw(value); return this; } catch (IOException ex) { throw new EsHadoopSerializationException(ex); } }
public void writeError( int status, String message ) throws IOException { if ( bytesWritten == 0 || bytesWritten == IS_ERROR ) { g.writeRaw( "null" ); } g.writeNumberField( "status", status ); if ( message != null && !message.trim().equals( Response.Status.fromStatusCode( status ).getReasonPhrase() ) ) { g.writeStringField( "message", message ); } else { if ( errorStream != null ) { g.writeStringField( "message", errorStream.toString( StandardCharsets.UTF_8.name() ) ); } } g.close(); } }
public void startOperation( String from, Integer id ) throws IOException { bytesWritten = 0; g.writeStartObject(); if ( id != null ) { g.writeNumberField( "id", id ); } g.writeStringField( "from", from ); g.writeRaw( ",\"body\":" ); g.flush(); }