org.wildfly.swarm.config.management.access

## Class JsonFormatter<T extends JsonFormatter<T>>

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap
    - - org.wildfly.swarm.config.management.access.JsonFormatter<T>

- All Implemented Interfaces:
    Serializable, Cloneable, Map

      public class JsonFormatter<T extends JsonFormatter<T>>
      extends HashMap

  A json formatter for audit log messages.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `Map.Entry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JsonFormatter(String key)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPropertyChangeListener(PropertyChangeListener listener)` Adds a property change listener
    `Boolean` | `compact()` If true will format the JSON on one line.
    `T` | `compact(Boolean value)` If true will format the JSON on one line.
    `String` | `dateFormat()` The date format to use as understood by `SimpleDateFormat`.
    `T` | `dateFormat(String value)` The date format to use as understood by `SimpleDateFormat`.
    `String` | `dateSeparator()` The separator between the date and the rest of the formatted log message.
    `T` | `dateSeparator(String value)` The separator between the date and the rest of the formatted log message.
    `Boolean` | `escapeControlCharacters()` If true will escape all control characters (ascii entries with a decimal value < 32) with the ascii code in octal, e.g.' becomes '#012'.
    `T` | `escapeControlCharacters(Boolean value)` If true will escape all control characters (ascii entries with a decimal value < 32) with the ascii code in octal, e.g.' becomes '#012'.
    `Boolean` | `escapeNewLine()` If true will escape all new lines with the ascii code in octal, e.g.
    `T` | `escapeNewLine(Boolean value)` If true will escape all new lines with the ascii code in octal, e.g.
    `String` | `getKey()`
    `Boolean` | `includeDate()` Whether or not to include the date in the formatted log record.
    `T` | `includeDate(Boolean value)` Whether or not to include the date in the formatted log record.
    `void` | `removePropertyChangeListener(PropertyChangeListener listener)` Removes a property change listener

    - ### Methods inherited from class java.util.HashMap

      `clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values`

    - ### Methods inherited from class java.util.AbstractMap

      `equals, hashCode, toString`

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

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `equals, hashCode`

- - ### Constructor Detail

    - #### JsonFormatter

          public JsonFormatter(String key)

  - ### Method Detail

    - #### getKey

          public String getKey()

    - #### addPropertyChangeListener

          public void addPropertyChangeListener(PropertyChangeListener listener)

      Adds a property change listener

    - #### removePropertyChangeListener

          public void removePropertyChangeListener(PropertyChangeListener listener)

      Removes a property change listener

    - #### compact

          public Boolean compact()

      If true will format the JSON on one line. There may still be values containing new lines, so if having the whole record on one line is important, set escape-new-line or escape-control-characters to true.

    - #### compact

          public T compact(Boolean value)

      If true will format the JSON on one line. There may still be values containing new lines, so if having the whole record on one line is important, set escape-new-line or escape-control-characters to true.

    - #### dateFormat

          public String dateFormat()

      The date format to use as understood by `SimpleDateFormat`. Will be ignored if include-date="false".

    - #### dateFormat

          public T dateFormat(String value)

      The date format to use as understood by `SimpleDateFormat`. Will be ignored if include-date="false".

    - #### dateSeparator

          public String dateSeparator()

      The separator between the date and the rest of the formatted log message. Will be ignored if include-date="false".

    - #### dateSeparator

          public T dateSeparator(String value)

      The separator between the date and the rest of the formatted log message. Will be ignored if include-date="false".

    - #### escapeControlCharacters

          public Boolean escapeControlCharacters()

      If true will escape all control characters (ascii entries with a decimal value < 32) with the ascii code in octal, e.g.' becomes '#012'. If this is true, it will override escape-new-line="false".

    - #### escapeControlCharacters

          public T escapeControlCharacters(Boolean value)

      If true will escape all control characters (ascii entries with a decimal value < 32) with the ascii code in octal, e.g.' becomes '#012'. If this is true, it will override escape-new-line="false".

    - #### escapeNewLine

          public Boolean escapeNewLine()

      If true will escape all new lines with the ascii code in octal, e.g. "#012".

    - #### escapeNewLine

          public T escapeNewLine(Boolean value)

      If true will escape all new lines with the ascii code in octal, e.g. "#012".

    - #### includeDate

          public Boolean includeDate()

      Whether or not to include the date in the formatted log record.

    - #### includeDate

          public T includeDate(Boolean value)

      Whether or not to include the date in the formatted log record.

Copyright © 2017 JBoss by Red Hat. All rights reserved.