@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final HasSchema<Object> hs = strategy.tryWritePojoIdTo(output, ID_POJO, (Class<Object>)value.getClass(), true); if (hs == null) { PolymorphicMapSchema.writeObjectTo(output, value, currentSchema, strategy); return; } final Schema<Object> schema = hs.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 HasSchema<Object> hs = strategy.tryWritePojoIdTo(output, ID_POJO, (Class<Object>)value.getClass(), true); if (hs == null) { PolymorphicMapSchema.writeObjectTo(output, value, currentSchema, strategy); return; } final Schema<Object> schema = hs.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 HasSchema<Object> hs = strategy.tryWritePojoIdTo(output, ID_POJO, (Class<Object>)value.getClass(), true); if (hs == null) { PolymorphicCollectionSchema.writeObjectTo(output, value, currentSchema, strategy); return; } final Schema<Object> schema = hs.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 HasSchema<Object> hs = strategy.tryWritePojoIdTo(output, ID_POJO, (Class<Object>)value.getClass(), true); if (hs == null) { PolymorphicCollectionSchema.writeObjectTo(output, value, currentSchema, strategy); return; } final Schema<Object> schema = hs.getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } schema.writeTo(output, value); }
HasSchema<Object> hs = strategy.tryWritePojoIdTo(output, ID_POJO, clazz, false); if (hs != null)
HasSchema<Object> hs = strategy.tryWritePojoIdTo(output, ID_POJO, clazz, false); if (hs != null)