Package juzu.impl.common

Examples of juzu.impl.common.JSON.names()


        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
        InputStream in = cl.getResourceAsStream("juzu/config.json");
        String serializedConfig = Tools.read(in);
        JSON config = (JSON)JSON.parse(serializedConfig);
        JSON applications = config.getJSON("application");
        if (applications.names().size() != 1) {
          throw new RuntimeException("Was expecting application size to be 1 instead of " + applications);
        }
        String packageFQN = applications.names().iterator().next();
        ApplicationDescriptor descriptor = ApplicationDescriptor.create(cl, packageFQN);
        // For now we don't resolve anything...
View Full Code Here


        JSON config = (JSON)JSON.parse(serializedConfig);
        JSON applications = config.getJSON("application");
        if (applications.names().size() != 1) {
          throw new RuntimeException("Was expecting application size to be 1 instead of " + applications);
        }
        String packageFQN = applications.names().iterator().next();
        ApplicationDescriptor descriptor = ApplicationDescriptor.create(cl, packageFQN);
        // For now we don't resolve anything...
        ResourceResolver resourceResolver = new ResourceResolver() {
          public URL resolve(String uri) {
            return null;
View Full Code Here

    HashMap<String, ParamDescriptor> parameters = null;
    JSON foo = config.getJSON("parameters");
    if (foo != null) {
      parameters = new HashMap<String, ParamDescriptor>();
      for (String name : foo.names()) {
        String pattern = foo.getJSON(name).getString("pattern");
        Boolean preservePath = foo.getJSON(name).getBoolean("preserve-path");
        Boolean captureGroup = foo.getJSON(name).getBoolean("capture-group");
        parameters.put(name, new ParamDescriptor(pattern, preservePath, captureGroup));
      }
View Full Code Here

      JSON json = (JSON)JSON.parse(url);

      //
      JSON jsonParams = json.getJSON("parameters");
      Map<String, String[]> parameters = new HashMap<String, String[]>();
      for (String name : jsonParams.names()) {
        List<? extends String> value = jsonParams.getList(name, String.class);
        parameters.put(name, value.toArray(new String[value.size()]));
      }

      //
View Full Code Here

    } 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)) {
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.