org.wildfly.swarm.config.management.access

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

- java.lang.Object
- - org.wildfly.swarm.config.management.access.JsonFormatter<T>

-     public class JsonFormatter<T extends JsonFormatter<T>>
      extends Object

  A json formatter for audit log messages.

- - ### 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 java.text.SimpleDateFormat.
    `T` | `dateFormat(String value)` The date format to use as understood by java.text.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.lang.Object

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

- - ### 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 java.text.SimpleDateFormat. Will be ignored if include-date="false".

    - #### dateFormat

          public T dateFormat(String value)

      The date format to use as understood by java.text.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.