X Tutup
Skip to content

Commit 9cb8e15

Browse files
committed
Added JavaDocs
1 parent 80c1479 commit 9cb8e15

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/main/java/org/json/XML.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,23 @@ public static String toString(final Object object, final String tagName, final X
755755
return toString(object, tagName, config, 0, 0);
756756
}
757757

758+
/**
759+
* Convert a JSONObject into a well-formed, element-normal XML string,
760+
* either pretty print or single-lined depending on indent factor.
761+
*
762+
* @param object
763+
* A JSONObject.
764+
* @param tagName
765+
* The optional name of the enclosing tag.
766+
* @param config
767+
* Configuration that can control output to XML.
768+
* @param indentFactor
769+
* The number of spaces to add to each level of indentation.
770+
* @param indent
771+
* The current ident level in spaces.
772+
* @return
773+
* @throws JSONException
774+
*/
758775
private static String toString(final Object object, final String tagName, final XMLParserConfiguration config, int indentFactor, int indent)
759776
throws JSONException {
760777
StringBuilder sb = new StringBuilder();
@@ -934,6 +951,13 @@ public static String toString(final Object object, final String tagName, final X
934951
return toString(object, tagName, config, indentFactor, 0);
935952
}
936953

954+
/**
955+
* Return a String consisting of a number of space characters specified by indent
956+
*
957+
* @param indent
958+
* The number of spaces to be appended to the String.
959+
* @return
960+
*/
937961
private static final String indent(int indent) {
938962
StringBuilder sb = new StringBuilder();
939963
for (int i = 0; i < indent; i++) {

0 commit comments

Comments
 (0)
X Tutup