Package org.codehaus.jackson.map.util

Examples of org.codehaus.jackson.map.util.JSONPObject


            generator.writeEndArray();

            generator.writeEndObject();
            generator.close();

            final JSONPObject object = new JSONPObject(callback, out.toString());
            return Response.ok(object).build();
        }
        catch (IOException e) {
            log.error("Error", e);
            return Response.serverError().build();
View Full Code Here


        if (viewToUse != null) {
            // TODO: change to use 'writerWithType' for 2.0 (1.9 could use, but let's defer)
            ObjectWriter viewWriter = mapper.viewWriter(viewToUse);
            // [JACKSON-245] Allow automatic JSONP wrapping
            if (_jsonpFunctionName != null) {
                viewWriter.writeValue(jg, new JSONPObject(this._jsonpFunctionName, value, rootType));
            } else if (rootType != null) {
                // TODO: change to use 'writerWithType' for 2.0 (1.9 could use, but let's defer)
                mapper.typedWriter(rootType).withView(viewToUse).writeValue(jg, value);
            } else {
                viewWriter.writeValue(jg, value);
            }
        } else {
            // [JACKSON-245] Allow automatic JSONP wrapping
            if (_jsonpFunctionName != null) {
                mapper.writeValue(jg, new JSONPObject(this._jsonpFunctionName, value, rootType));
            } else if (rootType != null) {
                // TODO: change to use 'writerWithType' for 2.0 (1.9 could use, but let's defer)
                mapper.typedWriter(rootType).writeValue(jg, value);
            } else {
                mapper.writeValue(jg, value);
View Full Code Here

                rootType = TypeFactory.type(genericType);
            }
        }
        // [JACKSON-245] Allow automatic JSONP wrapping
        if (_jsonpFunctionName != null) {
            mapper.writeValue(jg, new JSONPObject(_jsonpFunctionName, value, rootType));
        } else {
            // !!! TODO: 04-Mar-2010, tatus: As per [JACKSON-195], use root type!
            mapper.writeValue(jg, value);
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.map.util.JSONPObject

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.