本文整理汇总了Java中org.codehaus.jettison.json.JSONObject.length方法的典型用法代码示例。如果您正苦于以下问题:Java JSONObject.length方法的具体用法?Java JSONObject.length怎么用?Java JSONObject.length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.jettison.json.JSONObject
的用法示例。
在下文中一共展示了JSONObject.length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadViews
import org.codehaus.jettison.json.JSONObject; //导入方法依赖的package包/类
private void loadViews() {
JSONObject jsonDocument = getObject().getJSONObject();
JSONObject views = CouchKey.views.JSONObject(jsonDocument);
if (views != null) {
if (views.length() > 0) {
addChild(fViews);
}
for (Iterator<String> i = GenericUtils.cast(views.keys()); i.hasNext(); ) {
String key = i.next();
try {
ViewObject view = new ViewObject(key, views.getJSONObject(key));
fViews.addChild(new DesignDocumentViewTreeObject(viewer, view));
} catch (Exception e) {
Engine.logBeans.warn("[DesignDocument] view named '" + key + "' is null; skipping...");
}
}
}
}
示例2: loadFilters
import org.codehaus.jettison.json.JSONObject; //导入方法依赖的package包/类
private void loadFilters() {
JSONObject jsonDocument = getObject().getJSONObject();
JSONObject filters = CouchKey.filters.JSONObject(jsonDocument);
if (filters != null) {
if (filters.length() > 0) {
addChild(fFilters);
}
for (Iterator<String> i = GenericUtils.cast(filters.keys()); i.hasNext(); ) {
String key = i.next();
try {
FilterObject filter = new FilterObject(key, filters.getString(key));
fFilters.addChild(new DesignDocumentFilterTreeObject(viewer, filter));
} catch (Exception e) {
Engine.logBeans.warn("[DesignDocument] filter named '" + key + "' is null; skipping...");
}
}
}
}
示例3: loadUpdates
import org.codehaus.jettison.json.JSONObject; //导入方法依赖的package包/类
private void loadUpdates() {
JSONObject jsonDocument = getObject().getJSONObject();
JSONObject updates = CouchKey.updates.JSONObject(jsonDocument);
if (updates != null) {
if (updates.length() > 0) {
addChild(fUpdates);
}
for (Iterator<String> i = GenericUtils.cast(updates.keys()); i.hasNext(); ) {
String key = i.next();
try {
UpdateObject update = new UpdateObject(key, updates.getString(key));
fUpdates.addChild(new DesignDocumentUpdateTreeObject(viewer, update));
} catch (Exception e) {
Engine.logBeans.warn("[DesignDocument] update named '" + key + "' is null; skipping...");
}
}
}
}