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:
parent
5024f2d210
commit
e8b1b66888
9 changed files with 198 additions and 101 deletions
14
JSONML.java
14
JSONML.java
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue