Examples of JSONCallback


Examples of com.mongodb.util.JSONCallback

        DBObject answer = null;
        try {
            byte[] input = IOConverter.toBytes(is);
           
            if (isBson(input)) {
                BSONCallback callback = new JSONCallback();
                new BasicBSONDecoder().decode(input, callback);
                answer = (DBObject) callback.get();
            } else {
                answer = (DBObject) JSON.parse(IOConverter.toString(input, exchange));
            }
        } catch (Exception e) {
            LOG.warn("String -> DBObject conversion selected, but the following exception occurred. Returning null.", e);
View Full Code Here

Examples of com.mongodb.util.JSONCallback

        DBObject answer = null;
        try {
            byte[] input = IOConverter.toBytes(is);
           
            if (isBson(input)) {
                BSONCallback callback = new JSONCallback();
                new BasicBSONDecoder().decode(input, callback);
                answer = (DBObject) callback.get();
            } else {
                answer = (DBObject) JSON.parse(IOConverter.toString(input, exchange));
            }
        } catch (Exception e) {
            LOG.warn("String -> DBObject conversion selected, but the following exception occurred. Returning null.", e);
View Full Code Here

Examples of com.mongodb.util.JSONCallback

        DBObject answer = null;
        try {
            byte[] input = IOConverter.toBytes(is);
           
            if (isBson(input)) {
                BSONCallback callback = new JSONCallback();
                new BasicBSONDecoder().decode(input, callback);
                answer = (DBObject) callback.get();
            } else {
                answer = (DBObject) JSON.parse(IOConverter.toString(input, exchange));
            }
        } catch (Exception e) {
            LOG.warn("String -> DBObject conversion selected, but the following exception occurred. Returning null.", e);
View Full Code Here

Examples of com.mongodb.util.JSONCallback

        DBObject answer = null;
        try {
            byte[] input = IOConverter.toBytes(is);
           
            if (isBson(input)) {
                BSONCallback callback = new JSONCallback();
                new BasicBSONDecoder().decode(input, callback);
                answer = (DBObject) callback.get();
            } else {
                answer = (DBObject) JSON.parse(IOConverter.toString(input, exchange));
            }
        } catch (Exception e) {
            LOG.warn("String -> DBObject conversion selected, but the following exception occurred. Returning null.", e);
View Full Code Here

Examples of com.mongodb.util.JSONCallback

    /**
     * Create a new parser.
     */
    public JSONParser(String s, BSONCallback callback) {
        this.s = s;
        _callback = (callback == null) ? new JSONCallback() : callback;
    }
View Full Code Here

Examples of com.mongodb.util.JSONCallback

        final Object[] params = parameters;

        // Parse the query with a callback that will weave in marshalled parameters
        DBObject dbo;
        try {
            dbo = (DBObject) JSON.parse(sb.toString(), new JSONCallback() {

                int paramPos = 0;

                @Override
                public Object objectDone() {
View Full Code Here

Examples of com.totsp.gwittir.client.jsni.JSONCallback

            url+="&";
        }
        if( this.user != null ){
            url +="id="+this.user+"&";
        }
        JSONServiceInvoker.invoke(url, "jsonFlickrFeed", new JSONCallback(){
            public void onJSONResult(JavaScriptObjectDecorator decorator) {
                setTitle( decorator.getStringProperty("title") );
                JavaScriptObjectDecorator items = decorator.getJavaScriptObjectProperty("items");
                List photos = new ArrayList();
                for( int i=0; i < items.getIntProperty("length"); i++ ){
View Full Code Here

Examples of org.apache.tapestry5.services.ajax.JSONCallback

     * Invoked via an Ajax request. Triggers an action event and captures the return value. The return value from the
     * event notification is what will ultimately render (typically, its a Block).
     */
    void onInject(EventContext context) throws IOException
    {
        ajaxResponseRenderer.addCallback(new JSONCallback()
        {
            public void run(JSONObject reply)
            {
                clientId = javascriptSupport.allocateClientId(resources);

View Full Code Here

Examples of org.apache.tapestry5.services.ajax.JSONCallback

     * Invoked via an Ajax request. Triggers an action event and captures the return value. The return value from the
     * event notification is what will ultimately render (typically, its a Block).
     */
    void onInject(EventContext context) throws IOException
    {
        ajaxResponseRenderer.addCallback(new JSONCallback()
        {
            public void run(JSONObject reply)
            {
                clientId = javascriptSupport.allocateClientId(resources);

View Full Code Here

Examples of org.fusesource.restygwt.client.JsonCallback

        // a bit of an oddity.. the jsonp() request is NOT done async.
        // delayTestFinish(REQUEST_TIMEOUT);
    }

    private JsonCallback expectJsonIsSetTo(final JSONObject expected) {
        return new JsonCallback() {
            public void onSuccess(Method method, JSONValue response) {
                System.out.println("Got: " + response.toString());
                assertEquals(expected.toString(), response.toString());
                // finishTest();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.