Package org.nutz.json.impl

Examples of org.nutz.json.impl.JsonRenderImpl


     */
    public static void toJson(Writer writer, Object obj, JsonFormat format) {
        try {
            if (format == null)
                format = JsonFormat.nice();
            new JsonRenderImpl(writer, format).render(obj);
            writer.flush();
        }
        catch (IOException e) {
            throw Lang.wrapThrow(e, JsonException.class);
        }
View Full Code Here


   
    public Object convert(Object obj) {
        StringBuilder sb = new StringBuilder();
        Writer writer = new StringWriter(sb);
        try {
            new JsonRenderImpl(writer, format).render(obj);
            writer.flush();
            return sb.toString();
        } catch (IOException e) {
            throw Lang.wrapThrow(e, JsonException.class);
        }
View Full Code Here

TOP

Related Classes of org.nutz.json.impl.JsonRenderImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.