@Override public JSON getDescriptor(ApplicationMetaModel application) { return new JSON(); } }
@Override public JSON getDescriptor(ApplicationMetaModel application) { ElementHandle.Package handle = application.getHandle(); Boolean enabled = enabledMap.get(handle); return enabled != null && enabled ? new JSON() : null; } }
@Override public JSON toJSON() { return new JSON().set("type", type.getName()); }
@Override public JSON toJSON() { JSON json = new JSON(); json.map("values", getChildren(ControllerMetaModel.class)); return json; }
@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; } }
@Override public JSON toJSON() { JSON json = new JSON(); json.map("values", getChildren(TemplateMetaModel.class)); json.set("qn", qn); return json; }
public JSON toJSON() { JSON json = new JSON(); json.set("handle", handle); json.map("methods", getHandlers()); return json; }
public JSON toJSON() { JSON json = new JSON(); json.set("element", element); json.set("template", getChild(TemplateMetaModel.KEY)); return json; } }
public JSON toJSON() { JSON json = new JSON(); json.set("handle", handle); json.map("methods", getHandlers()); return json; }
public JSON toJSON() { JSON json = new JSON(); json.set("element", element); json.set("template", getChild(TemplateMetaModel.KEY)); return json; } }
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; }
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; }
@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; }
@Override public JSON toJSON() { return new JSON(). set("name", name). set("valueType", valueType). set("type", type). set("cardinality", cardinality); } }
@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; }
@Test public void testUnwrapArray() throws Exception { JSON json = new JSON().set("foo", (Object)new String[]{"bar_1", "bar_2"}); assertEquals(Arrays.asList("bar_1", "bar_2"), json.getList("foo")); }
public JSON toJSON() { JSON json = new JSON(); json.set("handle", handle); json.set("qn", handle.getPackageName().toString()); json.map("templates", getChild(TemplateContainerMetaModel.KEY)); json.map("controllers", getChild(ControllersMetaModel.KEY)); return json; }
@Test public void testNull() throws Exception { JSON json = new JSON().set("foo", null); String s = json.toString(); assertEquals("{\"foo\":null}", s); JSON unmarshalled = (JSON)JSON.parse(s); assertEquals(json, unmarshalled); }