Class XmlPrettyPrinter

java.lang.Object
esendex.sdk.java.parser.XmlPrettyPrinter

public class XmlPrettyPrinter extends Object
Pretty printer for the formating of XML in a neat indented fashion.
Author:
Mike Whittaker
  • Constructor Details

    • XmlPrettyPrinter

      public XmlPrettyPrinter()
  • Method Details

    • format

      public static String format(String input, int indent)
      Format a String as XML in a neat indented fashion. The input is simply returned if there is any problem parseing the XML
      Parameters:
      input - the XML to format
      indent - the required amount indent
      Returns:
      neatly indented XML or input if XML could not be parsed
    • format

      public static String format(String input)
      Convenience method for format(String, int) that defaults to an indent value of 2.
      Parameters:
      input - the XML to format
      Returns:
      neatly indented XML or input if XML could not be parsed