/** * Write an array of strings. * * @param value provides the strings to write. */ public void writeStringArray(List<String> value) throws IOException { writeStartArray(); for (String s : value) { writeString(s); } writeEndArray(); }
protected void writeSchemaName(NamedDataSchema schema) throws IOException { _builder.writeString(_currentNamespace.equals(schema.getNamespace()) ? schema.getName() : schema.getFullName()); }
schemaToJsonEncoder.encode(schema); _builder.writeFieldName(SchemaTranslator.OPTIONAL_DEFAULT_MODE_PROPERTY); _builder.writeString(_options.getOptionalDefaultMode().toString());
protected void encode(DataSchema schema, boolean originallyInlined) throws IOException { TypeRepresentation representation = selectTypeRepresentation(schema, originallyInlined); markEncountered(schema); if (schema.isPrimitive()) { _builder.writeString(schema.getUnionMemberKey()); } else if (schema instanceof NamedDataSchema) { encodeNamed((NamedDataSchema) schema, representation); } else { encodeUnnamed(schema); } }
/** * Encode custom Avro schema. * * @param schema the {@link DataSchema} to encode. * @return true if there is a custom Avro schema. */ protected boolean encodeCustomAvroSchema(DataSchema schema) throws IOException { boolean encodedCustomAvroSchema = false; AvroOverride avroOverride = _avroOverrideMap.getAvroOverride(schema); _avroOverrideFactory.emitExceptionIfThereAreErrors(); if (avroOverride != null) { if (avroOverride.getAccessCount() == 1) { _builder.writeData(avroOverride.getAvroSchemaDataMap()); encodedCustomAvroSchema = true; } else { _builder.writeString(avroOverride.getAvroSchemaFullName()); encodedCustomAvroSchema = true; } } return encodedCustomAvroSchema; }
_builder.writeString(DataSchemaConstants.NULL_TYPE); emittedNull = true;