Package 

Object FormatUtils


  • 
    public class FormatUtils
    
                        

    用于数据格式化的工具类,例如:格式化JSON、XML

    Utility class for data formatting (e.g., JSON, XML).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static FormatUtils INSTANCE
    • Method Summary

      Modifier and Type Method Description
      final static String formatJson(String json, Integer indentSpaces) 格式化JSON字符串Format JSON string.
      final static String formatJson(String json) 格式化JSON字符串Format JSON string.
      final static String formatXml(String xml, Integer indentSpaces) 格式化XML字符串Format XML string.
      final static String formatXml(String xml) 格式化XML字符串Format XML string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • formatJson

        @JvmOverloads() final static String formatJson(String json, Integer indentSpaces)

        格式化JSON字符串

        Format JSON string.

        Parameters:
        json - Input JSON string.
        indentSpaces - The number of spaces to indent for each level of nesting.
      • formatXml

        @JvmOverloads() final static String formatXml(String xml, Integer indentSpaces)

        格式化XML字符串

        Format XML string.

        Parameters:
        xml - Input XML string.
        indentSpaces - The number of spaces to indent for each level of nesting.