Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf803a5d

Browse files
entityify
1 parent7c14a3d commitf803a5d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

‎XML.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ of this software and associated documentation files (the "Software"), to deal
3131
* This provides static methods to convert an XML text into a JSONObject,
3232
* and to covert a JSONObject into an XML text.
3333
* @author JSON.org
34-
* @version2011-02-11
34+
* @version2012-10-26
3535
*/
3636
publicclassXML {
3737

38-
/** The Character '&'. */
38+
/** The Character '&'. */
3939
publicstaticfinalCharacterAMP =newCharacter('&');
4040

4141
/** The Character '''. */
@@ -50,7 +50,7 @@ public class XML {
5050
/** The Character '>'. */
5151
publicstaticfinalCharacterGT =newCharacter('>');
5252

53-
/** The Character '<'. */
53+
/** The Character '&lt;'. */
5454
publicstaticfinalCharacterLT =newCharacter('<');
5555

5656
/** The Character '?'. */
@@ -99,9 +99,9 @@ public static String escape(String string) {
9999
}
100100
returnsb.toString();
101101
}
102-
102+
103103
/**
104-
* Throw an exception if the string contains whitespace.
104+
* Throw an exception if the string contains whitespace.
105105
* Whitespace is not allowed in tagNames and attributes.
106106
* @param string
107107
* @throws JSONException
@@ -113,7 +113,7 @@ public static void noSpace(String string) throws JSONException {
113113
}
114114
for (i =0;i <length;i +=1) {
115115
if (Character.isWhitespace(string.charAt(i))) {
116-
thrownewJSONException("'" +string +
116+
thrownewJSONException("'" +string +
117117
"' contains a space character.");
118118
}
119119
}
@@ -196,7 +196,7 @@ private static boolean parse(XMLTokener x, JSONObject context,
196196
token =x.nextToken();
197197
if (name ==null) {
198198
throwx.syntaxError("Mismatched close tag " +token);
199-
}
199+
}
200200
if (!token.equals(name)) {
201201
throwx.syntaxError("Mismatched " +name +" and " +token);
202202
}
@@ -229,7 +229,7 @@ private static boolean parse(XMLTokener x, JSONObject context,
229229
if (!(tokeninstanceofString)) {
230230
throwx.syntaxError("Missing value");
231231
}
232-
jsonobject.accumulate(string,
232+
jsonobject.accumulate(string,
233233
XML.stringToValue((String)token));
234234
token =null;
235235
}else {
@@ -262,7 +262,7 @@ private static boolean parse(XMLTokener x, JSONObject context,
262262
}elseif (tokeninstanceofString) {
263263
string = (String)token;
264264
if (string.length() >0) {
265-
jsonobject.accumulate("content",
265+
jsonobject.accumulate("content",
266266
XML.stringToValue(string));
267267
}
268268

@@ -274,7 +274,7 @@ private static boolean parse(XMLTokener x, JSONObject context,
274274
context.accumulate(tagName,"");
275275
}elseif (jsonobject.length() ==1 &&
276276
jsonobject.opt("content") !=null) {
277-
context.accumulate(tagName,
277+
context.accumulate(tagName,
278278
jsonobject.opt("content"));
279279
}else {
280280
context.accumulate(tagName,jsonobject);
@@ -295,7 +295,7 @@ private static boolean parse(XMLTokener x, JSONObject context,
295295
* Try to convert a string into a number, boolean, or null. If the string
296296
* can't be converted, return the string. This is much less ambitious than
297297
* JSONObject.stringToValue, especially because it does not attempt to
298-
* convert plus forms, octal forms, hex forms, or E forms lacking decimal
298+
* convert plus forms, octal forms, hex forms, or E forms lacking decimal
299299
* points.
300300
* @param string A String.
301301
* @return A simple JSON value.
@@ -317,7 +317,7 @@ public static Object stringToValue(String string) {
317317
returnnewInteger(0);
318318
}
319319

320-
// If it might be a number, try converting it. If that doesn't work,
320+
// If it might be a number, try converting it. If that doesn't work,
321321
// return the string.
322322

323323
try {
@@ -347,7 +347,7 @@ public static Object stringToValue(String string) {
347347
returnstring;
348348
}
349349

350-
350+
351351
/**
352352
* Convert a well-formed (but not necessarily valid) XML string into a
353353
* JSONObject. Some information may be lost in this transformation
@@ -505,4 +505,4 @@ public static String toString(Object object, String tagName)
505505
}
506506
}
507507
}
508-
}
508+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp