}
println("\"api\": [");
if (query != null) {
levelUp();
for (int i = 0; i < alts.size(); i++) {
ResponseFormat alt = alts.get(i);
String label = alt.name().toUpperCase();
if (alt == ResponseFormat.htmlfragment) {
label = "FRAGMENT";
}
if (alt == ResponseFormat.pjson) {
label = "JSON";
}
if (alt == ResponseFormat.xjson) {
label = "JSON (Extended)";
}
String url = query.getRssSourceUrl().replaceAll(
"f=" + ResponseFormat.pjson + "|f=" + ResponseFormat.json + "|f=" + ResponseFormat.xjson,
"f=" + (alt == ResponseFormat.json ? ResponseFormat.pjson : alt));
printLink(url, alt.name(), label, "", i < alts.size() - 1);
}
levelDown();
}
println("]" + (more ? "," : ""));
}