Package com.metaparadigm.jsonrpc

Examples of com.metaparadigm.jsonrpc.SerializerState


    message.put("method", methodTag);

    JSONArray params= new JSONArray();
    if (args!=null) {
      for(Object arg: args) {
        SerializerState state= new SerializerState();
        params.put(message2Object.marshall(state, arg));
      }
    }
    message.put("params", params);
    message.put("id", 1);
    JSONObject responseMessage= session.sendAndReceive(message);
    if (!responseMessage.has("result"))
      processException(responseMessage);
    Object rawResult= responseMessage.get("result");
    if (rawResult==null) {
      processException(responseMessage);
    }
    Class<?> returnType= method.getReturnType();
    if (returnType.equals(Void.TYPE))
      return null;
    SerializerState state= new SerializerState();
    return message2Object.unmarshall(state, returnType, rawResult);
  }
View Full Code Here


    public Object toJSON(Object source) throws Exception {
        if (source == null) {
            return org.json.JSONObject.NULL;
        }

        SerializerState state = new SerializerState();
        return serializer.marshall(state, source);
    }
View Full Code Here

        if (source == null) {
            return null;
        }

        try {
            SerializerState state = new SerializerState();
            return serializer.unmarshall(state, context.getTargetDataType().getPhysical(), source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
View Full Code Here

        if (source == null) {
            return null;
        }

        try {
            SerializerState state = new SerializerState();
            return serializer.unmarshall(state, context.getTargetDataType().getPhysical(), source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
View Full Code Here

        if (source == null) {
            return null;
        }

        try {
            SerializerState state = new SerializerState();
            return serializer.unmarshall(state, context.getTargetDataType().getPhysical(), source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
View Full Code Here

        if (source == null) {
            return null;
        }

        try {
            SerializerState state = new SerializerState();
            return serializer.unmarshall(state, context.getTargetDataType().getPhysical(), source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
View Full Code Here

    public Object toJSON(Object source) throws Exception {
        if (source == null) {
            return org.json.JSONObject.NULL;
        }

        SerializerState state = new SerializerState();
        return serializer.marshall(state, source);
    }
View Full Code Here

TOP

Related Classes of com.metaparadigm.jsonrpc.SerializerState

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.