/** * Convenience method that serializes given value but so that results are * stored in given {@link Properties} instance. */ public Properties writeValueAsProperties(Object value, JavaPropsSchema schema) throws IOException { Properties props = new Properties(); writeValue(props, value, schema); return props; }
/** * Convenience method that serializes given value but so that results are * stored in a newly constructed {@link Properties}. Functionally equivalent * to serializing in a File and reading contents into {@link Properties}. */ public Properties writeValueAsProperties(Object value) throws IOException { Properties props = new Properties(); writeValue(props, value); return props; }
/** * Convenience method that serializes given value but so that results are * stored in given {@link Properties} instance. * * @since 2.9 */ public Properties writeValueAsProperties(Object value, JavaPropsSchema schema) throws IOException { Properties props = new Properties(); writeValue(props, value, schema); return props; }
/** * Convenience method that serializes given value but so that results are * stored in a newly constructed {@link Properties}. Functionally equivalent * to serializing in a File and reading contents into {@link Properties}. * * @since 2.9 */ public Properties writeValueAsProperties(Object value) throws IOException { Properties props = new Properties(); writeValue(props, value); return props; }
/** * Convenience method that "writes" given `value` as properties * in given {@link Properties} object. * * @since 2.9 */ public void writeValue(Properties targetProps, Object value) throws IOException { if (targetProps == null) { throw new IllegalArgumentException("Can not pass null Properties as target"); } JavaPropsGenerator g = ((JavaPropsFactory) getFactory()) .createGenerator(targetProps); writeValue(g, value); g.close(); }
/** * Convenience method that "writes" given `value` as properties * in given {@link Properties} object. */ public void writeValue(Properties targetProps, Object value) throws IOException { if (targetProps == null) { throw new IllegalArgumentException("Can not pass null Properties as target"); } DefaultSerializerProvider prov = _serializerProvider(); JavaPropsGenerator g = tokenStreamFactory() .createGenerator(prov, targetProps); writeValue(g, value); g.close(); }
/** * Convenience method that "writes" given `value` as properties * in given {@link Properties} object. * * @since 2.9 */ public void writeValue(Properties targetProps, Object value, JavaPropsSchema schema) throws IOException { if (targetProps == null) { throw new IllegalArgumentException("Can not pass null Properties as target"); } JavaPropsGenerator g = ((JavaPropsFactory) getFactory()) .createGenerator(targetProps); if (schema != null) { g.setSchema(schema); } writeValue(g, value); g.close(); }
/** * Convenience method that "writes" given `value` as properties * in given {@link Properties} object. */ public void writeValue(Properties targetProps, Object value, JavaPropsSchema schema) throws IOException { if (targetProps == null) { throw new IllegalArgumentException("Can not pass null Properties as target"); } DefaultSerializerProvider prov = _serializerProvider(); JavaPropsGenerator g = tokenStreamFactory() .createGenerator(prov, targetProps); if (schema != null) { g.setSchema(schema); } writeValue(g, value); g.close(); }