@Test public void skipNull() throws Exception { StringWriter sw = new StringWriter(); SomeNullProperty o = new SomeNullProperty(); builder.get(SomeNullProperty.class).writeTo(o, TreePruner.DEFAULT, Flavor.JSON.createDataWriter(o, sw, config)); assertEquals("{'_class':'SomeNullProperty','bbb':'bbb','ccc':null,'ddd':'ddd'}", sw.toString().replace('"','\'')); }
public void writeTo(T object, DataWriter writer) throws IOException { writeTo(object, 0, writer); }
Model { public void writeTo(T object, DataWriter writer) throws IOException { writeTo(object, 0, writer); } }
Model { public void writeTo(T object, DataWriter writer) throws IOException { writeTo(object, 0, writer); } Model(ModelBuilder parent, Class<T> type, @CheckForNull Class<?> propertyOwner, @Nullable String property); }
Model { public void writeTo(T object, DataWriter writer) throws IOException { writeTo(object, 0, writer); } Model(ModelBuilder parent, Class<T> type, @CheckForNull Class<?> propertyOwner, @Nullable String property); List<Property> getProperties(); void writeTo(T object, DataWriter writer); void writeTo(T object, TreePruner pruner, DataWriter writer); @Deprecated void writeTo(T object, int baseVisibility, DataWriter writer); }
Model { public void writeTo(T object, DataWriter writer) throws IOException { writeTo(object, 0, writer); } Model(ModelBuilder parent, Class<T> type, @CheckForNull Class<?> propertyOwner, @Nullable String property); List<Property> getProperties(); void writeTo(T object, DataWriter writer); void writeTo(T object, TreePruner pruner, DataWriter writer); @Deprecated void writeTo(T object, int baseVisibility, DataWriter writer); final Class<T> type; final Model<? super T> superModel; }