本文整理汇总了Java中org.apache.tapestry5.json.JSONArray类的典型用法代码示例。如果您正苦于以下问题:Java JSONArray类的具体用法?Java JSONArray怎么用?Java JSONArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JSONArray类属于org.apache.tapestry5.json包,在下文中一共展示了JSONArray类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: appendToLog
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
public JavaScriptCallback appendToLog(List<String> text) {
return new JavaScriptCallback() {
public void run(JavaScriptSupport javascriptSupport) {
javaScriptSupport.require("appendconsole").with(escape(svdrpCommand), "svdrpconsole", "svdrpinput",
JSONArray.from(text));
}
};
}
开发者ID:Zabrimus,项目名称:vdr-jonglisto,代码行数:10,代码来源:SvdrpConsole.java
示例2: openStream
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
@Override
public InputStream openStream() throws IOException {
Vector<InputStream> v = new Vector<InputStream>(3);
// https://github.com/jrburke/requirejs/issues/1476
try (InputStream is = resource.openStream(); Scanner scanner = new Scanner(is, "utf-8")) {
scanner.useDelimiter(STARTOFINPUT);
String content = scanner.next();
Pattern pattern = Pattern.compile("(?<=require\\()(['\"])(.*?)(?:\\.js)?\\1(?=\\))");
Matcher matcher = pattern.matcher(content);
JSONArray dependencies = new JSONArray("require", "exports", "module");
StringBuffer sb = new StringBuffer(content.length());
while (matcher.find()) {
String module = matcher.group(2);
// rewrite require('module.js') to require('module')
matcher.appendReplacement(sb, "$1$2$1");
dependencies.put(module);
}
matcher.appendTail(sb);
content = sb.toString();
InputStream leaderStream = toInputStream(
"define(" + dependencies.toCompactString() + ", function(require, exports, module) {\n");
InputStream trailerStream = toInputStream("\n});");
v.add(leaderStream);
v.add(new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)));
v.add(trailerStream);
}
return new SequenceInputStream(v.elements());
}
开发者ID:eddyson-de,项目名称:tapestry-webjars,代码行数:34,代码来源:CommonJSAMDWrapper.java
示例3: getData
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
public JSONArray getData(){
return
new JSONArray(
new JSONArray(0.1, 0.2, 0.3, 0.4),
new JSONArray(0.2, 0.3, 0.4, 0.5),
new JSONArray(0.3, 0.4, 0.5, 0.6),
new JSONArray(0.4, 0.5, 0.6, 0.7),
new JSONArray(0.5, 0.6, 0.7, 0.8)
);
}
开发者ID:got5,项目名称:tapestry5-d3,代码行数:11,代码来源:GroupedBarChartPage.java
示例4: getData
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
public JSONArray getData(){
JSONObject o1= new JSONObject();
o1.put("label", "one");
o1.put("value", 20.0);
JSONObject o2= new JSONObject();
o2.put("label", "two");
o2.put("value", 50.0);
JSONObject o3= new JSONObject();
o3.put("label", "three");
o3.put("value", 30.0);
return new JSONArray(o1, o2, o3);
}
开发者ID:got5,项目名称:tapestry5-d3,代码行数:15,代码来源:PieChartPage.java
示例5: provideValues
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
@PublishEvent
@OnEvent("providevalues")
Object provideValues() {
return new JSONObject("values", new JSONArray(new JSONObject("value", "one", "label", "One"),
new JSONObject("value", "two", "label", "Two"), new JSONObject("value", "three", "label", "Three")));
}
开发者ID:eddyson-de,项目名称:tapestry-react-select,代码行数:7,代码来源:ReactSelectAsyncDemo.java
示例6: getData
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
public JSONArray getData(){
return this.data;
}
开发者ID:got5,项目名称:tapestry5-d3,代码行数:4,代码来源:DimpleGroupedBarChartPage.java
示例7: getData
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
public JSONArray getData(){
return new JSONArray(
25, 7, 5, 26, 11, 8, 25, 14, 23, 19,
14, 11, 22, 29, 11, 13, 12, 17, 18, 10,
24, 18, 25, 9, 3);
}
开发者ID:got5,项目名称:tapestry5-d3,代码行数:7,代码来源:BarChartPage.java
示例8: onReturnStreamResponse
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
@OnEvent(value="phones")
JSONArray onReturnStreamResponse() {
String phones= catalog.getPhonesAsString();
return new JSONArray(phones);
}
开发者ID:ffacon,项目名称:tapestry5-angular-demo,代码行数:6,代码来源:Index.java
示例9: getOptions
import org.apache.tapestry5.json.JSONArray; //导入依赖的package包/类
public JSONObject getOptions() {
return new JSONObject("lang", locale.getLanguage()).put("containersItems",
new JSONArray().put(new JSONObject("name", "article", "title", "Article", "css", "wym_containers_article")));
}
开发者ID:thiagohp,项目名称:eloquentia,代码行数:5,代码来源:EditPage.java
注:本文中的org.apache.tapestry5.json.JSONArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论