@@ -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