Package net.jangaroo.exml.json

Examples of net.jangaroo.exml.json.JsonArray


            return Double.parseDouble(attributeValue);
          case UINT:
          case INT:
            return Long.parseLong(attributeValue);
          case ARRAY:
            return new JsonArray(attributeValue);
        }
      }
    }
    // code expression, Object or specific type. We don't care (for now).
    return attributeValue;
View Full Code Here


  private void fillJsonObjectProperty(ExmlModel model, JsonObject jsonObject, String propertyName, boolean configTypeArray, List<Element> childElements) {
    List<Object> childObjects = parseChildObjects(model, childElements);
    if (childObjects.size() > 1 || configTypeArray) {
      // TODO: Check for type violation
      // We must write an array.
      JsonArray jsonArray = new JsonArray(childObjects.toArray());
      jsonObject.set(propertyName, jsonArray);
    } else if (childObjects.size() == 1) {
      // The property is either unspecified, untyped, or object-typed
      // and it contains a single child element. Use that element as the
      // property value.
View Full Code Here

            "layoutConfig", new JsonObject(
                    "bla", "blub",
                    "anchor", new JsonObject("style", "test"),
                    "border", new JsonObject("type", "solid")
            ),
            "items", new JsonArray(
                    new JsonObject(
                            "xtype", "button",
                            "text", "Save"
                    ),
                    "{{xtype: \"editortreepanel\"}}"
            ),
            "menu", new JsonArray(
                    new JsonObject(
                            "xtype", "menuitem",
                            "text", "juhu1"
                    ),
                    new JsonObject(
                            "xtype", "menuitem",
                            "text", "juhu2"
                    ),
                    new JsonObject(
                            "xtype", "menuitem",
                            "text", "juhu3"
                    )
            ),
            "tools", new JsonArray(
                    new JsonObject(
                            "handler", "{function(x){return ''+x;}}",
                            "id", "gear"
                    )
            ),
            "plugins", new JsonArray(
                    new JsonObject(
                            "ptype", "aplugin"
                    ),
                    new JsonObject(
                            "ptype", "aplugin"
View Full Code Here

    ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestNumber.exml"));
    Assert.assertEquals("ext.Panel", model.getSuperClassName());

    JsonObject expectedJsonObject = new JsonObject(
            "items", new JsonArray(
                    new JsonObject(
                            "xtype", "panel",
                            "id", "foo",
                             "x", 100.0
                    ),
View Full Code Here

    ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestTrueFalse.exml"));
    Assert.assertEquals("ext.Panel", model.getSuperClassName());

    JsonObject expectedJsonObject = new JsonObject(
            "items", new JsonArray(
                    new JsonObject(
                            "xtype", "panel",
                            "id", "foo",
                             "visible", true
                    ),
View Full Code Here

    ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestArrayAttribute.exml"));
    Assert.assertEquals("ext.Panel", model.getSuperClassName());

    JsonObject expectedJsonObject = new JsonObject(
            "items", "{config.myItems}",
            "tools", new JsonArray("tools")
    );
    System.out.println(model.getJsonObject().toString(2));
    Assert.assertEquals(expectedJsonObject.toString(2), model.getJsonObject().toString(2));
  }
View Full Code Here

    ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestUntyped.exml"));
    Assert.assertEquals("ext.Panel", model.getSuperClassName());

    JsonObject expectedJsonObject = new JsonObject(
            "items", new JsonArray(
                    new JsonObject(
                            "xtype", "panel",
                             "untyped", "text"
                    ),
                    new JsonObject(
View Full Code Here

    ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestTyped.exml"));
    Assert.assertEquals("ext.Panel", model.getSuperClassName());

    JsonObject expectedJsonObject = new JsonObject(
            "items", new JsonArray(
                    new JsonObject(
                            "xtype", "component",
                            "margins", "5" // not the number 5!
                    ),
                    new JsonObject(
View Full Code Here

    ExmlModel model = exmlToModelParser.parse(getFile("/testPackage/TestComponent2.exml"));
    Assert.assertEquals("testPackage.TestComponent", model.getSuperClassName());

    JsonObject expectedJsonObject = new JsonObject(
            "items", new JsonArray(
                    new JsonObject(
                            "propertyThree", "3"
                    ).settingWrapperClass("testNamespace.config.testComponent2")
            ),
            "columns", new JsonObject("xtype", "agridcolumn")
View Full Code Here

              new JsonObject(
                      "xtype", "button",
                      "text", "{config.title + '!'}"
              ),
            "arrayPropertyWithDefaultElement",
              new JsonArray(
                      new JsonObject(
                              "xtype", "button",
                              "text", "button1"
                      ),
                      new JsonObject(
View Full Code Here

TOP

Related Classes of net.jangaroo.exml.json.JsonArray

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.