Examples of JsonHelper


Examples of org.butor.json.JsonHelper

          methodsMap.put(key, m);
        }
      }
    }

    final JsonHelper jsh = new JsonHelper();

    InvocationHandler ih = new InvocationHandler() {
      //private Logger logger = LoggerFactory.getLogger(this.getClass());
      @Override
      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        AjaxContext actx = (AjaxContext)args[0];
        try {
          String key = buildKey(method.getName(), args.length);
          Method target = methodsMap.get(key);
          if (target == null) {
            //TODO
            return null;
          }

          Context ctx = scf.getContext(actx.getRequest().getUserId(),
              actx.getRequest().getSessionId(), actx.getRequest().getReqId(),
              actx.getRequest().getLang(), actx.getResponseHandler());

          Object[] serviceArgs = new Object[args.length];
          serviceArgs[0] = ctx;
          for (int ii=1; ii<args.length;ii++)
            serviceArgs[ii] = args[ii];

          JsonServiceRequest jsr = (JsonServiceRequest)ctx.getRequest();
          String sargs = jsh.serialize(serviceArgs);
          //logger.info("calling service {} with args {}", method.getName(), sargs);
          jsr.setService(method.getName());
          jsr.setServiceArgsJson(sargs);

          return target.invoke(serviceCaller, serviceArgs);
View Full Code Here

Examples of org.butor.json.JsonHelper

        return commonRequestArgs;
      }
    };
  }
  public static CommonRequestArgs getCommonRequestArgs(String commonRequestJSON) {
    CommonRequestArgs commonRequestArgs = new JsonHelper().deserialize(commonRequestJSON, CommonRequestArgs.class);
    return commonRequestArgs;
  }
View Full Code Here

Examples of org.butor.json.JsonHelper

        }
      }
    }
  }
  public static JsonHelper getJsonHelperWithLocalTimeFormatter() {
    return new JsonHelper("yyyy-MM-dd HH:mm:ss.SSS");
  }
View Full Code Here

Examples of org.platformlayer.xml.JsonHelper

          case JSON:
            if (debug != null) {
              debug.println("Data: [JSON Content]");
            }

            JsonHelper jsonHelper = JsonHelper.build(sendData.getClass());
            String json = jsonHelper.marshal(sendData, false);
            httpRequest.setRequestContent(new Utf8StringByteSource(json));
            // jsonHelper.marshal(sendData, false, getOutputStream());
            break;
          default:
            throw new IllegalStateException();
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.