Package juzu.impl.common

Examples of juzu.impl.common.JSON


      public void renderURL(PropertyMap properties, MimeType mimeType, Appendable appendable) throws IOException {
        //
        ControllerHandler handler = application.resolveBean(ControllerService.class).getDescriptor().getMethodByHandle(target);

        //
        JSON props = new JSON();
        if (properties != null) {
          for (PropertyType<?> property : properties) {
            Object value = properties.getValue(property);
            String valid = _checkPropertyValidity(handler.getPhase(), property, value);
            if (valid != null) {
              throw new IllegalArgumentException(valid);
            }
            else {
              props.set(property.getClass().getName(), value);
            }
          }
        }

        //
        HashMap<String, String[]> foo = new HashMap<String, String[]>();
        for (ResponseParameter parameter : parameters.values()) {
          foo.put(parameter.getName(), parameter.toArray());
        }

        //
        JSON url = new JSON();
        url.set("target", target.toString());
        url.map("parameters", foo);
        url.set("properties", props);

        //
        url.toString(appendable);
      }
    };
  }
View Full Code Here


          return n1 == n2;
        }
      }
    } else {
      if (o1 instanceof JSON && o2 instanceof JSON) {
        JSON js1 = (JSON)o1;
        JSON js2 = (JSON)o2;
        HashSet<String> names = new HashSet<String>(js1.names());
        names.addAll(js2.names());
        for (String name : names) {
          js1.getArray("", Object.class);
          Object v1 = js1.get(name);
          Object v2 = js2.get(name);
          if (!equalsIgnoreNull(v1, v2)) {
            return false;
          }
        }
        return true;
View Full Code Here

    app.init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    JSON url = (JSON)JSON.parse(render.assertStringResponse());
    assertFalse(url.getJSON("properties").contains(PropertyType.ESCAPE_XML.getClass().getName()));
  }
View Full Code Here

    app.init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    JSON url = (JSON)JSON.parse(render.assertStringResponse());
    assertEquals(Boolean.TRUE, url.getJSON("properties").get(PropertyType.ESCAPE_XML.getClass().getName()));
  }
View Full Code Here

TOP

Related Classes of juzu.impl.common.JSON

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.