Package juzu.impl.common

Examples of juzu.impl.common.JSON


    return supportedAnnotations;
  }

  @Override
  public JSON toJSON() {
    JSON json = new JSON();
    for (ModuleMetaModelPlugin plugin : context.getPlugins()) {
      JSON pluginJSON = plugin.toJSON(this);
      json.set(plugin.getName(), pluginJSON);
    }
    return json;
  }
View Full Code Here


    //
    env.info("Emitting module config");

    // Merge plugins
    JSON descriptor = null;
    for (ModuleMetaModelPlugin plugin : context.getPlugins()) {
      JSON pluginDesc = plugin.getDescriptor(this);
      if (pluginDesc != null) {
        if (descriptor == null) {
          descriptor = new JSON();
        }
        descriptor.set(plugin.getName(), pluginDesc);
      }
    }

    // Add source path if any
    if (root != null) {
      if (descriptor == null) {
        descriptor = new JSON();
      }
      descriptor.set("sourcepath", root.getAbsolutePath());
    }

    // Emit descriptor
View Full Code Here

    }
  }

  @Override
  public JSON getDescriptor(ApplicationMetaModel application) {
    JSON config = new JSON();
    AbstractContainerMetaModel metaModel = application.getChild(TemplateContainerMetaModel.KEY);
    LinkedHashSet<String> templates = new LinkedHashSet<String>();
    for (TemplateRefMetaModel ref : metaModel.getChildren(TemplateRefMetaModel.class)) {
      if (ref instanceof ElementMetaModel) {
        templates.add(((ElementMetaModel)ref).getPath().getName().toString());
      }
    }
    config.map("templates", templates);
    config.set("package", metaModel.getQN().toString());
    return config;
  }
View Full Code Here

    Collection<ApplicationMetaModel> applications = metaModel.getChildren(ApplicationMetaModel.class);
    if (applications != null && applications.size() > 0) {
      for (ApplicationMetaModel application : applications) {

        //
        JSON descriptor = new JSON();
        metaModel.processingContext.info("Emitting application " + application.getHandle() + " config");

        // Emit config
        for (ApplicationMetaModelPlugin plugin : context.getPlugins()) {
          JSON pluginDescriptor = plugin.getDescriptor(application);
          if (pluginDescriptor != null) {
            descriptor.set(plugin.getName(), pluginDescriptor);
          }
        }
View Full Code Here

    }
  }

  @Override
  public JSON getDescriptor(ModuleMetaModel metaModel) {
    JSON json = null;
    Collection<ApplicationMetaModel> applications = metaModel.getChildren(ApplicationMetaModel.class);
    if (applications != null && applications.size() > 0) {
      json = new JSON();
      for (ApplicationMetaModel application : applications) {
        json.set(application.getHandle().getPackageName().toString(), new JSON());
      }
    }
    return json;
  }
View Full Code Here

    this.templates = new HashMap<Path.Absolute, TemplateMetaModel>();
  }

  @Override
  public JSON toJSON() {
    JSON json = new JSON();
    json.map("values", getChildren(TemplateMetaModel.class));
    json.set("qn", qn);
    return json;
  }
View Full Code Here

    return alias != null ? alias : name;
  }

  @Override
  public JSON toJSON() {
    return new JSON().
        set("name", name).
        set("valueType", valueType).
        set("type", type).
        set("cardinality", cardinality);
  }
View Full Code Here

  public Iterator<HandlerMetaModel> iterator() {
    return getHandlers().iterator();
  }

  public JSON toJSON() {
    JSON json = new JSON();
    json.set("handle", handle);
    json.map("methods", getHandlers());
    return json;
  }
View Full Code Here

    this.plugin = plugin;
  }

  @Override
  public JSON toJSON() {
    JSON json = new JSON();
    json.map("values", getChildren(ControllerMetaModel.class));
    return json;
  }
View Full Code Here

    this.parameters = parameters;
    this.id = id;
  }

  public JSON toJSON() {
    JSON json = new JSON();
    json.set("method", method);
    json.set("id", declaredId);
    json.set("phase", phase);
    json.set("name", name);
    json.map("parameters", new ArrayList<ParameterMetaModel>(parameters));
    return json;
  }
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.