Package org.jboss.errai.marshalling.client.api.json

Examples of org.jboss.errai.marshalling.client.api.json.EJObject.containsKey()


            throw new RuntimeException("unknown type to demarshall");
          }

          return newInstance;
        }
        else if (oMap.containsKey(SerializationParts.ENUM_STRING_VALUE)) {
          return Enum.valueOf(getClassReference(oMap), oMap.get(SerializationParts.ENUM_STRING_VALUE).isString().stringValue());
        }
        else {
          throw new RuntimeException("bad payload");
        }
View Full Code Here


    public String determineTypeFor(String formatType, Object o) {
      EJValue jsonValue = (EJValue) o;

      if (jsonValue.isObject() != null) {
        EJObject jsonObject = jsonValue.isObject();
        if (jsonObject.containsKey(SerializationParts.ENCODED_TYPE)) {
          return jsonObject.get(SerializationParts.ENCODED_TYPE).isString().stringValue();
        }
        else {
          return Map.class.getName();
        }
View Full Code Here

      EJString string = jsObject.get(SerializationParts.ENCODED_TYPE).isString();
      if (string == null) {
        return MapMarshaller.INSTANCE.demarshall(o, ctx);
      }

      if (jsObject.containsKey(SerializationParts.NUMERIC_VALUE)) {
        return NumbersUtils.getNumber(string.stringValue(), jsObject.get(SerializationParts.NUMERIC_VALUE));
      }

      Marshaller<Object> marshaller = ctx.getMarshallerInstance(string.stringValue());
View Full Code Here

    public String determineTypeFor(String formatType, Object o) {
      EJValue jsonValue = (EJValue) o;

      if (jsonValue.isObject() != null) {
        EJObject jsonObject = jsonValue.isObject();
        if (jsonObject.containsKey(SerializationParts.ENCODED_TYPE)) {
          return jsonObject.get(SerializationParts.ENCODED_TYPE).isString().stringValue();
        }
        else {
          return Map.class.getName();
        }
View Full Code Here

  public String determineTypeFor(String formatType, Object o) {
    EJValue jsonValue = (EJValue) o;

    if (jsonValue.isObject() != null) {
      EJObject jsonObject = jsonValue.isObject();
      if (jsonObject.containsKey(SerializationParts.ENCODED_TYPE)) {
        return jsonObject.get(SerializationParts.ENCODED_TYPE).isString().stringValue();
      }
      else {
        return Map.class.getName();
      }
View Full Code Here

      EJString string = jsObject.get(SerializationParts.ENCODED_TYPE).isString();
      if (string == null) {
        return MapMarshaller.INSTANCE.demarshall(o, ctx);
      }

      if (jsObject.containsKey(SerializationParts.NUMERIC_VALUE)) {
        return NumbersUtils.getNumber(string.stringValue(), jsObject.get(SerializationParts.NUMERIC_VALUE));
      }

      Marshaller<Object> marshaller = ctx.getMarshallerInstance(string.stringValue());
View Full Code Here

          }
          else {
            /**
             * Check to see if this object is instantiate only... meaning it has no fields to marshall.
             */
            if (oMap.containsKey(SerializationParts.INSTANTIATE_ONLY)) {
              newInstance = getTypeHandled().newInstance();
              ctx.recordObject(objID, newInstance);
              return newInstance;
            }

View Full Code Here

            }
          }

          return newInstance;
        }
        else if (oMap.containsKey(SerializationParts.ENUM_STRING_VALUE)) {
          return Enum.valueOf(getClassReference(oMap),
                  oMap.get(SerializationParts.ENUM_STRING_VALUE).isString().stringValue());
        }
        else {
          throw new RuntimeException("bad payload");
View Full Code Here

    @Override
    public String determineTypeFor(final String formatType, final Object o) {
      if (((EJValue) o).isObject() != null) {
        final EJObject jsonObject = ((EJValue) o).isObject();
        if (jsonObject.containsKey(SerializationParts.ENCODED_TYPE)) {
          return jsonObject.get(SerializationParts.ENCODED_TYPE).isString().stringValue();
        }
        else {
          return Map.class.getName();
        }
View Full Code Here

      final EJValue elem = array.get(i);
      if (!elem.isNull()) {
        String type = null;
        final EJObject jsonObject;
        if ((jsonObject = elem.isObject()) != null) {
          if (!jsonObject.containsKey(SerializationParts.ENCODED_TYPE)) {
            // for collections with a concrete type parameter, we treat the ^EncodedType value as optional
            type = assumedElementType;
          }
        }
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.