本文整理匯總了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...");
}
}
}
}