public static void marshalException(Throwable exception, CallContext ctx, OutputStream out) throws IOException { out.write(EXCEPTION_TAG_OPEN); out.write(EXCEPTION_CLASS_TAG_OPEN); ctx.createWrapperFromObject(exception.getClass().getName(), "").marshal(out); out.write(EXCEPTION_CLASS_TAG_CLOSE); out.write(MESSAGE_TAG_OPEN); ctx.createWrapperFromObject(exception.getMessage(), "").marshal(out); out.write(MESSAGE_TAG_CLOSE); out.write(EXCEPTION_TAG_CLOSE); }
public static void marshalException(Throwable exception, CallContext ctx, OutputStream out) throws IOException { out.write(EXCEPTION_TAG_OPEN); out.write(MESSAGE_TAG_OPEN); ctx.createWrapperFromObject(exception.getMessage(), "").marshal(out); out.write(MESSAGE_TAG_CLOSE); out.write(EXCEPTION_TAG_CLOSE); }
public void marshal(OutputStream out) throws IOException { out.write(MAP_TAG_OPEN); Map m = (Map) this.value; for (Object key : m.keySet()) { out.write(ELEMENT_TAG_OPEN); out.write(KEY_TAG_OPEN); context.createWrapperFromObject(key, String.format("%s[key]", path)) .marshal(out); out.write(KEY_TAG_CLOSE); out.write(VALUE_TAG_OPEN); context.createWrapperFromObject(m.get(key), String.format("%s[value]", path)).marshal(out); out.write(VALUE_TAG_CLOSE); out.write(ELEMENT_TAG_CLOSE); } out.write(MAP_TAG_CLOSE); }
public void marshal(OutputStream out) throws IOException { out.write(MAP_TAG_OPEN); Map m = (Map) this.value; for (Object key : m.keySet()) { out.write(ELEMENT_TAG_OPEN); out.write(KEY_TAG_OPEN); context.createWrapperFromObject(key, String.format("%s[key]", path)).marshal(out); out.write(KEY_TAG_CLOSE); out.write(VALUE_TAG_OPEN); context.createWrapperFromObject(m.get(key), String.format("%s[value]", path)).marshal(out); out.write(VALUE_TAG_CLOSE); out.write(ELEMENT_TAG_CLOSE); } out.write(MAP_TAG_CLOSE); }
public void marshal(OutputStream out) throws IOException { out.write(MAP_TAG_OPEN); Map m = (Map) this.value; for (Object key : m.keySet()) { out.write(ELEMENT_TAG_OPEN); out.write(KEY_TAG_OPEN); context.createWrapperFromObject(key, String.format("%s[key]", path)) .marshal(out); out.write(KEY_TAG_CLOSE); out.write(VALUE_TAG_OPEN); context.createWrapperFromObject(m.get(key), String.format("%s[value]", path)).marshal(out); out.write(VALUE_TAG_CLOSE); out.write(ELEMENT_TAG_CLOSE); } out.write(MAP_TAG_CLOSE); }
public static void marshalModelExpand(Model model, Wrapper value, OutputStream out, int newRefIdx) throws IOException { out.write(MODEL_TAG_OPEN_START); out.write(model.getId().getBytes()); out.write(MODEL_TAG_OPEN_END); out.write(RESULT_TAG_OPEN); value.marshal(out); out.write(RESULT_TAG_CLOSE); if (model.getCallContext().getOutRefs().size() > newRefIdx) { out.write(RequestHandler.REFS_TAG_OPEN); marshalNewRefs(model.getCallContext().getOutRefs(), newRefIdx, null, out); out.write(RequestHandler.REFS_TAG_CLOSE); } out.write(MODEL_TAG_CLOSE); }
context.createWrapperFromObject(val, path).marshal(out); out.write(ELEMENT_TAG_CLOSE);
public static void marshalModelExpand(Model model, Wrapper value, OutputStream out, int newRefIdx) throws IOException { out.write(MODEL_TAG_OPEN_START); out.write(model.getId().getBytes()); out.write(MODEL_TAG_OPEN_END); out.write(RESULT_TAG_OPEN); value.marshal(out); out.write(RESULT_TAG_CLOSE); if (model.getCallContext().getOutRefs().size() > newRefIdx) { out.write(RequestHandler.REFS_TAG_OPEN); marshalNewRefs(model.getCallContext().getOutRefs(), newRefIdx, null, out); out.write(RequestHandler.REFS_TAG_CLOSE); } out.write(MODEL_TAG_CLOSE); }
ctx.createWrapperFromObject(value, "").marshal(out); out.write(VALUE_TAG_CLOSE);
public static void marshalModel(Model model, OutputStream out) throws IOException { out.write(MODEL_TAG_OPEN_START); out.write(model.getId().getBytes()); out.write(MODEL_TAG_OPEN_END); for (String alias : model.getBeanProperties().keySet()) { Model.BeanProperty property = model.getBeanProperties().get(alias); out.write(ALIASED_VALUE_TAG_OPEN_START); out.write(alias.getBytes()); out.write(ALIASED_VALUE_TAG_OPEN_END); model.getCallContext().createWrapperFromObject(property.getValue(), "") .marshal(out); out.write(ALIASED_VALUE_TAG_CLOSE); } out.write(RequestHandler.REFS_TAG_OPEN); marshalRefs(model.getCallContext().getOutRefs(), null, out); out.write(RequestHandler.REFS_TAG_CLOSE); out.write(MODEL_TAG_CLOSE); }
context.createWrapperFromObject(val, path).marshal(out); out.write(ELEMENT_TAG_CLOSE);
context.createWrapperFromObject(val, path).marshal(out); out.write(ELEMENT_TAG_CLOSE);
ctx.createWrapperFromObject(value, "").marshal(out); out.write(VALUE_TAG_CLOSE);
public static void marshalModel(Model model, OutputStream out) throws IOException { out.write(MODEL_TAG_OPEN_START); out.write(model.getId().getBytes()); out.write(MODEL_TAG_OPEN_END); for (String alias : model.getBeanProperties().keySet()) { Model.BeanProperty property = model.getBeanProperties().get(alias); out.write(ALIASED_VALUE_TAG_OPEN_START); out.write(alias.getBytes()); out.write(ALIASED_VALUE_TAG_OPEN_END); model.getCallContext().createWrapperFromObject(property.getValue(), "") .marshal(out); out.write(ALIASED_VALUE_TAG_CLOSE); } out.write(RequestHandler.REFS_TAG_OPEN); marshalRefs(model.getCallContext().getOutRefs(), null, out); out.write(RequestHandler.REFS_TAG_CLOSE); out.write(MODEL_TAG_CLOSE); }
if (w != null) { w.setPath(fieldPath); w.marshal(out);
public static void marshalCallResult(Call call, OutputStream out) throws IOException { out.write(RESULT_TAG_OPEN); if (call.getException() != null) { marshalException(call.getException(), call.getContext(), out); } else { out.write(VALUE_TAG_OPEN); call.getContext().createWrapperFromObject(call.getResult(), "") .marshal(out); out.write(VALUE_TAG_CLOSE); out.write(RequestHandler.REFS_TAG_OPEN); marshalRefs(call.getContext().getOutRefs(), call.getConstraints(), out); out.write(RequestHandler.REFS_TAG_CLOSE); } out.write(RESULT_TAG_CLOSE); }
public static void marshalCallResult(Call call, OutputStream out) throws IOException { out.write(RESULT_TAG_OPEN); if (call.getException() != null) { marshalException(call.getException(), call.getContext(), out); } else { out.write(VALUE_TAG_OPEN); call.getContext().createWrapperFromObject(call.getResult(), "") .marshal(out); out.write(VALUE_TAG_CLOSE); out.write(RequestHandler.REFS_TAG_OPEN); marshalRefs(call.getContext().getOutRefs(), call.getConstraints(), out); out.write(RequestHandler.REFS_TAG_CLOSE); } out.write(RESULT_TAG_CLOSE); }