de.caff.io.json

## Class Json

- java.lang.Object
- - de.caff.io.json.Json

-     public class Json
      extends java.lang.Object

  JSON tools.
  Since:
    2022/05/01
  Author:
    Rammi

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Json.Env` Environment.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(java.lang.String[] args)`
    `static java.lang.String` | `maskForOutput(java.lang.String str)` Mask special characters in the given string for JSON output.
    `static java.lang.String` | `unmaskFromInput(java.lang.String str)` Unmask special characters in the incoming string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### maskForOutput

          @NotNull
          public static java.lang.String maskForOutput(@NotNull
                                                                java.lang.String str)

      Mask special characters in the given string for JSON output. This method takes care of special characters like `"`, `\`, `\n` and similar.
      Parameters:
        `str` - str
      Returns:
        masked string

    - #### unmaskFromInput

          @NotNull
          public static java.lang.String unmaskFromInput(@NotNull
                                                                  java.lang.String str)
                                                           throws java.io.IOException

      Unmask special characters in the incoming string. This method undoes the masking from maskForOutput(String) and recreates `"`, `\`, `\n` and similar.
      Parameters:
        `str` - incoming JSON string
      Returns:
        unmasked Java string
      Throws:
        `java.io.IOException` - if `str` contains invalid escape sequences

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`