1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

Updates for supporting the Android API

This commit is contained in:
John J. Aylward 2017-06-21 11:52:15 -04:00
parent 5024f2d210
commit e8b1b66888
9 changed files with 198 additions and 101 deletions

View file

@ -1,7 +1,5 @@
package org.json;
import java.util.Map.Entry;
/*
Copyright (c) 2008 JSON.org
@ -416,10 +414,10 @@ public class JSONML {
// Emit the attributes
for (final Entry<String, ?> entry : jo.entrySet()) {
final String key = entry.getKey();
// Don't use the new entrySet API to maintain Android support
for (final String key : jo.keySet()) {
final Object value = jo.opt(key);
XML.noSpace(key);
final Object value = entry.getValue();
if (value != null) {
sb.append(' ');
sb.append(XML.escape(key));
@ -495,11 +493,11 @@ public class JSONML {
//Emit the attributes
for (final Entry<String, ?> entry : jo.entrySet()) {
final String key = entry.getKey();
// Don't use the new entrySet API to maintain Android support
for (final String key : jo.keySet()) {
if (!"tagName".equals(key) && !"childNodes".equals(key)) {
XML.noSpace(key);
value = entry.getValue();
value = jo.opt(key);
if (value != null) {
sb.append(' ');
sb.append(XML.escape(key));