@Override public final void writeStringField(String fieldName, String value) throws IOException { writeFieldName(fieldName); writeString(value); }
protected void _verifyPrettyValueWrite(String typeMsg, int status) throws IOException { // If we have a pretty printer, it knows what to do: switch (status) { case JsonWriteContext.STATUS_OK_AFTER_COMMA: // array _cfgPrettyPrinter.writeArrayValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AFTER_COLON: _cfgPrettyPrinter.writeObjectFieldValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AFTER_SPACE: _cfgPrettyPrinter.writeRootValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AS_IS: // First entry, but of which context? if (_writeContext.inArray()) { _cfgPrettyPrinter.beforeArrayValues(this); } else if (_writeContext.inObject()) { _cfgPrettyPrinter.beforeObjectEntries(this); } break; case JsonWriteContext.STATUS_EXPECT_NAME: _reportCantWriteValueExpectName(typeMsg); break; default: _throwInternal(); break; } }
protected void _reportCantWriteValueExpectName(String typeMsg) throws IOException { _reportError(String.format("Can not %s, expecting field name (context: %s)", typeMsg, _writeContext.typeDesc())); } }
@Override public void close() throws IOException super.close();
public JsonGeneratorImpl(IOContext ctxt, int features, ObjectCodec codec) { super(features, codec); _ioContext = ctxt; if (isEnabled(Feature.ESCAPE_NON_ASCII)) { setHighestNonEscapedChar(127); } }
@Override public void close() throws IOException super.close();
public JsonGeneratorImpl(IOContext ctxt, int features, ObjectCodec codec) { super(features, codec); _ioContext = ctxt; if (isEnabled(Feature.ESCAPE_NON_ASCII)) { setHighestNonEscapedChar(127); } }
@Override public final void writeStringField(String fieldName, String value) throws IOException { writeFieldName(fieldName); writeString(value); }
@Override public void close() throws IOException super.close();
protected void _verifyPrettyValueWrite(String typeMsg, int status) throws IOException { // If we have a pretty printer, it knows what to do: switch (status) { case JsonWriteContext.STATUS_OK_AFTER_COMMA: // array _cfgPrettyPrinter.writeArrayValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AFTER_COLON: _cfgPrettyPrinter.writeObjectFieldValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AFTER_SPACE: _cfgPrettyPrinter.writeRootValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AS_IS: // First entry, but of which context? if (_outputContext.inArray()) { _cfgPrettyPrinter.beforeArrayValues(this); } else if (_outputContext.inObject()) { _cfgPrettyPrinter.beforeObjectEntries(this); } break; case JsonWriteContext.STATUS_EXPECT_NAME: _reportCantWriteValueExpectName(typeMsg); break; default: _throwInternal(); break; } }
protected void _reportCantWriteValueExpectName(String typeMsg) throws IOException { _reportError(String.format("Can not %s, expecting field name (context: %s)", typeMsg, _outputContext.typeDesc())); } }
public JsonGeneratorImpl(IOContext ctxt, int features, ObjectCodec codec) { super(features, codec); _ioContext = ctxt; if (isEnabled(Feature.ESCAPE_NON_ASCII)) { setHighestNonEscapedChar(127); } }
@Override public final void writeStringField(String fieldName, String value) throws IOException, JsonGenerationException { writeFieldName(fieldName); writeString(value); } }
@Override public void close() throws IOException super.close(); if (_outputBuffer != null && isEnabled(StreamWriteFeature.AUTO_CLOSE_CONTENT)) {
protected void _verifyPrettyValueWrite(String typeMsg, int status) throws IOException { // If we have a pretty printer, it knows what to do: switch (status) { case JsonWriteContext.STATUS_OK_AFTER_COMMA: // array _cfgPrettyPrinter.writeArrayValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AFTER_COLON: _cfgPrettyPrinter.writeObjectFieldValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AFTER_SPACE: _cfgPrettyPrinter.writeRootValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AS_IS: // First entry, but of which context? if (_writeContext.inArray()) { _cfgPrettyPrinter.beforeArrayValues(this); } else if (_writeContext.inObject()) { _cfgPrettyPrinter.beforeObjectEntries(this); } break; case JsonWriteContext.STATUS_EXPECT_NAME: _reportCantWriteValueExpectName(typeMsg); break; default: _throwInternal(); break; } }
protected void _reportCantWriteValueExpectName(String typeMsg) throws IOException { _reportError(String.format("Can not %s, expecting field name (context: %s)", typeMsg, _writeContext.typeDesc())); } }
@Override public final void writeStringField(String fieldName, String value) throws IOException, JsonGenerationException { writeFieldName(fieldName); writeString(value); } }
throws IOException super.close();
protected void _verifyPrettyValueWrite(String typeMsg, int status) throws IOException { // If we have a pretty printer, it knows what to do: switch (status) { case JsonWriteContext.STATUS_OK_AFTER_COMMA: // array _cfgPrettyPrinter.writeArrayValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AFTER_COLON: _cfgPrettyPrinter.writeObjectFieldValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AFTER_SPACE: _cfgPrettyPrinter.writeRootValueSeparator(this); break; case JsonWriteContext.STATUS_OK_AS_IS: // First entry, but of which context? if (_writeContext.inArray()) { _cfgPrettyPrinter.beforeArrayValues(this); } else if (_writeContext.inObject()) { _cfgPrettyPrinter.beforeObjectEntries(this); } break; case JsonWriteContext.STATUS_EXPECT_NAME: _reportCantWriteValueExpectName(typeMsg); break; default: _throwInternal(); break; } }
protected void _reportCantWriteValueExpectName(String typeMsg) throws IOException { _reportError(String.format("Can not %s, expecting field name (context: %s)", typeMsg, _writeContext.typeDesc())); } }