@Override public StructuredJsonGenerator writeEndObject() { try { writer.stepOut(); } catch (IOException e) { throw new SdkClientException(e); } return this; }
@Override public StructuredJsonGenerator writeEndArray() { try { writer.stepOut(); } catch (IOException e) { throw new SdkClientException(e); } return this; }
@Override public StructuredJsonGenerator writeEndObject() { try { writer.stepOut(); } catch (IOException e) { throw new SdkClientException(e); } return this; }
@Override public StructuredJsonGenerator writeEndArray() { try { writer.stepOut(); } catch (IOException e) { throw new SdkClientException(e); } return this; }
/** * writes an IonList with a series of IonInt values. This * starts a List, writes the values (without any annoations) * and closes the list. For text and tree writers this is * just a convienience, but for the binary writer it can be * optimized internally. * @param values signed short values to populate the lists int's with */ public static void writeIntList(IonWriter writer, short[] values) throws IOException { if (writer instanceof PrivateListWriter) { ((PrivateListWriter)writer).writeIntList(values); return; } writer.stepIn(IonType.LIST); for (int ii=0; ii<values.length; ii++) { writer.writeInt(values[ii]); } writer.stepOut(); }
/** * writes an IonList with a series of IonBool values. This * starts a List, writes the values (without any annoations) * and closes the list. For text and tree writers this is * just a convienience, but for the binary writer it can be * optimized internally. * @param values boolean values to populate the list with */ public static void writeBoolList(IonWriter writer, boolean[] values) throws IOException { if (writer instanceof PrivateListWriter) { ((PrivateListWriter)writer).writeBoolList(values); return; } writer.stepIn(IonType.LIST); for (int ii=0; ii<values.length; ii++) { writer.writeBool(values[ii]); } writer.stepOut(); }
/** * writes an IonList with a series of IonInt values. This * starts a List, writes the values (without any annoations) * and closes the list. For text and tree writers this is * just a convienience, but for the binary writer it can be * optimized internally. * @param values signed int values to populate the lists int's with */ public static void writeIntList(IonWriter writer, int[] values) throws IOException { if (writer instanceof PrivateListWriter) { ((PrivateListWriter)writer).writeIntList(values); return; } writer.stepIn(IonType.LIST); for (int ii=0; ii<values.length; ii++) { writer.writeInt(values[ii]); } writer.stepOut(); }
/** * writes an IonList with a series of IonInt values. This * starts a List, writes the values (without any annoations) * and closes the list. For text and tree writers this is * just a convienience, but for the binary writer it can be * optimized internally. * @param values signed long values to populate the lists int's with */ public static void writeIntList(IonWriter writer, long[] values) throws IOException { if (writer instanceof PrivateListWriter) { ((PrivateListWriter)writer).writeIntList(values); return; } writer.stepIn(IonType.LIST); for (int ii=0; ii<values.length; ii++) { writer.writeInt(values[ii]); } writer.stepOut(); }
/** * writes an IonList with a series of IonFloat values. This * starts a List, writes the values (without any annoations) * and closes the list. For text and tree writers this is * just a convienience, but for the binary writer it can be * optimized internally. * @param values 64 bit float values to populate the lists IonFloat's with */ public static void writeFloatList(IonWriter writer, double[] values) throws IOException { if (writer instanceof PrivateListWriter) { ((PrivateListWriter)writer).writeFloatList(values); return; } writer.stepIn(IonType.LIST); for (int ii=0; ii<values.length; ii++) { writer.writeFloat(values[ii]); } writer.stepOut(); }
/** * writes an IonList with a series of IonInt values. This * starts a List, writes the values (without any annoations) * and closes the list. For text and tree writers this is * just a convienience, but for the binary writer it can be * optimized internally. * @param values signed byte values to populate the lists int's with */ public static void writeIntList(IonWriter writer, byte[] values) throws IOException { if (writer instanceof PrivateListWriter) { ((PrivateListWriter)writer).writeIntList(values); return; } writer.stepIn(IonType.LIST); for (int ii=0; ii<values.length; ii++) { writer.writeInt(values[ii]); } writer.stepOut(); }
/** * writes an IonList with a series of IonString values. This * starts a List, writes the values (without any annoations) * and closes the list. For text and tree writers this is * just a convienience, but for the binary writer it can be * optimized internally. * @param values Java String to populate the lists IonString's from */ public static void writeStringList(IonWriter writer, String[] values) throws IOException { if (writer instanceof PrivateListWriter) { ((PrivateListWriter)writer).writeStringList(values); return; } writer.stepIn(IonType.LIST); for (int ii=0; ii<values.length; ii++) { writer.writeString(values[ii]); } writer.stepOut(); } }
/** * writes an IonList with a series of IonFloat values. This * starts a List, writes the values (without any annoations) * and closes the list. For text and tree writers this is * just a convienience, but for the binary writer it can be * optimized internally. Note that since, currently, IonFloat * is a 64 bit float this is a helper that simply casts * the passed in floats to double before writing them. * @param values 32 bit float values to populate the lists IonFloat's with */ public static void writeFloatList(IonWriter writer, float[] values) throws IOException { if (writer instanceof PrivateListWriter) { ((PrivateListWriter)writer).writeFloatList(values); return; } writer.stepIn(IonType.LIST); for (int ii=0; ii<values.length; ii++) { writer.writeFloat(values[ii]); } writer.stepOut(); }
@Override final void writeBodyTo(IonWriter writer, SymbolTableProvider symbolTableProvider) throws IOException { if (isNullValue()) { writer.writeNull(IonType.STRUCT); } else { writer.stepIn(IonType.STRUCT); writeChildren(writer, this, symbolTableProvider); writer.stepOut(); } }
@Override void writeBodyTo(IonWriter writer, SymbolTableProvider symbolTableProvider) throws IOException { IonType type = getType(); if (isNullValue()) { writer.writeNull(type); } else { writer.stepIn(type); writeChildren(writer, this, symbolTableProvider); writer.stepOut(); } }
private static void doPrintVersion() throws IOException { IonTextWriterBuilder b = IonTextWriterBuilder.pretty(); b.setCharset(IonTextWriterBuilder.ASCII); IonWriter w = b.build((Appendable)System.out); w.stepIn(IonType.STRUCT); { w.setFieldName("version"); w.writeString(info.getProjectVersion()); w.setFieldName("build_time"); w.writeTimestamp(info.getBuildTime()); } w.stepOut(); w.finish(); System.out.println(); } }
@Override public StructuredJsonGenerator writeEndArray() { try { writer.stepOut(); } catch (IOException e) { throw SdkClientException.builder().cause(e).build(); } return this; }
@Override public StructuredJsonGenerator writeEndObject() { try { writer.stepOut(); } catch (IOException e) { throw SdkClientException.builder().cause(e).build(); } return this; }
@Override public StructuredJsonGenerator writeEndArray() { try { writer.stepOut(); } catch (IOException e) { throw SdkClientException.builder().cause(e).build(); } return this; }
@Override public void writeEndObject() throws IOException, JsonGenerationException { _outputContext = _outputContext.getParent(); // <-- copied from UTF8JsonGenerator _writer.stepOut(); }