Package com.google.gwt.json.client

Examples of com.google.gwt.json.client.JSONBoolean.booleanValue()


    attributeJsObj = childObj.get("className");
    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
      DOM.setElementAttribute(widget.getElement(), "className", attributeStringObj.stringValue());
    attributeJsObj = childObj.get(HasVkAnimation.NAME);
    if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
      ((HasVkAnimation)widget).setAnimationEnabled(attributeBooleanObj.booleanValue());
    attributeJsObj = childObj.get(HasVkSwitchNumberedWidget.NAME);
    if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null)
      ((HasVkSwitchNumberedWidget)widget).showWidget((int)attributeNumberObj.doubleValue());
   
    attributeJsObj = childObj.get(HasVkBeforeSelectionHandler.NAME);
View Full Code Here


    @Override
    public void setJSONValue(JSONValue value) {
      JSONBoolean boolVal = value.isBoolean();
      JSONString stringVal = value.isString();
      if (boolVal != null) {
        checkbox.setValue(boolVal.booleanValue());
      } else if (stringVal != null) {
        checkbox.setValue(Boolean.parseBoolean(stringVal.stringValue()));
      } else {
        throw new JSONException("Not a valid JSON boolean: " + value.toString());
      }
View Full Code Here

      return true;
    }
    else if (v1.isBoolean() != null) {
      JSONBoolean b1 = v1.isBoolean();
      JSONBoolean b2 = v2.isBoolean();
      return b1.booleanValue() == b2.booleanValue();
    }
    else if (v1.isNull() != null) {
      // this case should never be triggered, because of the getClass() precheck above
      return v2.isNull() != null;
    }
View Full Code Here

      // Assert
      assertEquals("json string", string.stringValue());
      assertEquals(3.0, number.doubleValue(), 0);
      assertEquals(3.1415, fl.doubleValue(), 0);
      assertTrue(bool.booleanValue());
      // array
      assertEquals(1.0, ((JSONNumber) array.get(0)).doubleValue(), 0);
      assertEquals(33.7, ((JSONNumber) array.get(1)).doubleValue(), 0);
      assertEquals("l33t", ((JSONString) array.get(2)).stringValue());
      // object
View Full Code Here

      // Assert
      assertEquals("json string", string.stringValue());
      assertEquals(3.0, number.doubleValue(), 0);
      assertEquals(3.1415, fl.doubleValue(), 0);
      assertTrue(bool.booleanValue());
      // array
      assertEquals(1.0, ((JSONNumber) array.get(0)).doubleValue(), 0);
      assertEquals(33.7, ((JSONNumber) array.get(1)).doubleValue(), 0);
      assertEquals("l33t", ((JSONString) array.get(2)).stringValue());
      // object
View Full Code Here

    JSONBoolean jbool = a_Value.get("resize").isBoolean();
    if (jbool == null)
    {
      throw new RuntimeException("JBool was null.");
    }
    m_Resize = jbool.booleanValue();
    if (m_Resize)
    {
      m_MaxWidth  = Integer.parseInt(a_Value.get("max_width").toString());
      m_MaxHeight = Integer.parseInt(a_Value.get("max_height").toString());
    }
View Full Code Here

   */
  private static Boolean getJsonBooleanValue(JSONObject json, String key) {
    JSONValue value = json.get(key);
    JSONBoolean bool = (value == null) ? null : value.isBoolean();
    if (bool != null) {
      return bool.booleanValue();
    } else {
      return null;
    }
  }

View Full Code Here

      final JSONBoolean jsonBoolean = jsonValue.isBoolean();
      if (null == jsonBoolean) {
        break;
      }

      value = jsonBoolean.booleanValue();
      break;
    }

    return value;
  }
View Full Code Here

    if(value == null)
      return null;
    JSONBoolean b = value.isBoolean();
    if( b == null)
      return null;
    return new Boolean(b.booleanValue());
  }

  public static String getJsonString(JSONObject object, String key) {
    JSONValue value = object.get(key);
    if (value == null)
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.