Examples of DecodingContext


Examples of org.jboss.errai.common.client.types.DecodingContext

  }

  @SuppressWarnings({"unchecked"})
  public static Map<String, Object> decodeMap(Object value) {
    try {
      DecodingContext ctx = new DecodingContext();
      Map<String, Object> map = (Map<String, Object>) JSONDecoderCli.decode(value, ctx);

      if (ctx.isUnsatisfiedDependencies()) {
        JSONTypeHelper.resolveDependencies(ctx);
      }

      return map;
    }
View Full Code Here

Examples of org.jboss.errai.common.client.types.DecodingContext

import static org.jboss.errai.common.client.types.TypeDemarshallers.hasDemarshaller;


public class JSONDecoderCli {
    public static Object decode(Object value) {
        DecodingContext ctx = new DecodingContext();
        Object v = null;

        if (value instanceof String) {
            v = _decode(JSONParser.parse((String) value), ctx);
        } else if (value instanceof JSONValue) {
            v = _decode((JSONValue) value, ctx);
        } else if (value != null) {
            throw new RuntimeException("could not decode type: " + value.getClass());
        }

        if (ctx.isUnsatisfiedDependencies()) {
            JSONTypeHelper.resolveDependencies(ctx);
        }

        return v;
    }
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.