Class JsonIndenter

java.lang.Object
edu.internet2.middleware.grouperClient.util.JsonIndenter

public class JsonIndenter extends Object
indent json, assumes the input is not yet indented. Also, this is only for testing or logging or documentation purposes, not production
  • Constructor Details

    • JsonIndenter

      public JsonIndenter(String theJson)
      Parameters:
      theJson - is the json to format indenter
  • Method Details

    • result

      public String result()
      get the result
      Returns:
      the result
    • instantIndent

      public static boolean instantIndent(String json, int index)
      see if instant indent
      Parameters:
      json -
      index -
      Returns:
      if it is an instant indent
    • instantNewline

      public static boolean instantNewline(String json, int index)
      see if instant indent
      Parameters:
      json -
      index -
      Returns:
      if it is an instant indent
    • instantUnindent

      public static boolean instantUnindent(String json, int index)
      see if instant unindent
      Parameters:
      json -
      index -
      Returns:
      if it is an instant unindent
    • instantUnindentTwoChars

      public static boolean instantUnindentTwoChars(String json, int index)
      see if instant indent
      Parameters:
      json -
      index -
      Returns:
      if it is an instant indent
    • findNextStartTagIndex

      public static int findNextStartTagIndex(String json, int startFrom)
      find the start tag from json and a start from index either look for a quote, {, [ or scalar. generally not whitespace
      Parameters:
      json -
      startFrom -
      Returns:
      the start tag index of -1 if not found another
    • findNextEndTagIndex

      public static int findNextEndTagIndex(String json, int startFrom)
      find the end tag from json and a start from index
      Parameters:
      json -
      startFrom - is the char after the start of tag
      Returns:
      the start tag index of -1 if not found another
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: