@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO, (Class<Object>) value.getClass()).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } schema.writeTo(output, value); }
@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO, (Class<Object>) value.getClass()).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } schema.writeTo(output, value); }
/** * Delegates to the schema derived from the {@code value}. */ @Override @SuppressWarnings("unchecked") public void writeTo(final Output output, final Object value) throws IOException { final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO, (Class<Object>) value.getClass()).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, this); } // write the rest of the fields of the exact type schema.writeTo(output, value); }
/** * Delegates to the schema derived from the {@code value}. */ @Override @SuppressWarnings("unchecked") public void writeTo(final Output output, final Object value) throws IOException { final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO, (Class<Object>) value.getClass()).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, this); } // write the rest of the fields of the exact type schema.writeTo(output, value); }
@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final Schema<Object> schema = strategy.writePojoIdTo(output, ID_THROWABLE, (Class<Object>) value.getClass()).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } if (tryWriteWithoutCause(output, value, schema)) return; schema.writeTo(output, value); }
@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final Schema<Object> schema = strategy.writePojoIdTo(output, ID_THROWABLE, (Class<Object>) value.getClass()).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } if (tryWriteWithoutCause(output, value, schema)) return; schema.writeTo(output, value); }
@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final Class<Object> clazz = (Class<Object>) value.getClass(); final RuntimeFieldFactory<Object> inline = RuntimeFieldFactory .getInline(clazz); if (inline != null) { // scalar value inline.writeTo(output, inline.id, value, false); return; } // AtomicInteger/AtomicLong final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO, clazz).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } schema.writeTo(output, value); }
@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final Class<Object> clazz = (Class<Object>) value.getClass(); final RuntimeFieldFactory<Object> inline = RuntimeFieldFactory .getInline(clazz); if (inline != null) { // scalar value inline.writeTo(output, inline.id, value, false); return; } // AtomicInteger/AtomicLong final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO, clazz).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } schema.writeTo(output, value); }
hs = strategy.writePojoIdTo(output, ID_ARRAY_POJO, (Class<Object>) componentType); final Schema<Object> schema = strategy.writePojoIdTo( output, ID_POJO, clazz).getSchema(); final Schema<Object> schema = strategy.writePojoIdTo( output, ID_POJO, clazz).getSchema();
hs = strategy.writePojoIdTo(output, ID_ARRAY_POJO, (Class<Object>) componentType); final Schema<Object> schema = strategy.writePojoIdTo( output, ID_POJO, clazz).getSchema(); final Schema<Object> schema = strategy.writePojoIdTo( output, ID_POJO, clazz).getSchema();