BasicXMLEncoder (Grails 6.0.0)

Package: org.grails.encoder.impl

## [Java] Class BasicXMLEncoder

- org.grails.encoder.impl.BasicXMLEncoder

-     public class BasicXMLEncoder
      extends AbstractCharReplacementEncoder

  Encoder implementation that escapes some characters for inclusion in XML documents Currently ', ", <, > and & characters are replaced with XML entities. Additionally backslash (/), non-breaking space, backtick (`) and @ are also replaced for visibility/additional security.

  Authors:
    Lari Hotari
  Since:
    2.3

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static java.lang.String` | `ESCAPED_AMP` |
    `private static java.lang.String` | `ESCAPED_APOS` |
    `private static java.lang.String` | `ESCAPED_AT` |
    `private static java.lang.String` | `ESCAPED_BACKSLASH` |
    `private static java.lang.String` | `ESCAPED_BACKTICK` |
    `private static java.lang.String` | `ESCAPED_GT` |
    `private static java.lang.String` | `ESCAPED_LINE_SEPARATOR` |
    `private static java.lang.String` | `ESCAPED_LT` |
    `private static java.lang.String` | `ESCAPED_NON_BREAKING_SPACE` |
    `private static java.lang.String` | `ESCAPED_PARAGRAPH_SEPARATOR` |
    `private static java.lang.String` | `ESCAPED_QUOTE` |
    `private static char` | `LINE_SEPARATOR` |
    `private static char` | `NBSP` |
    `private static char` | `PARAGRAPH_SEPARATOR` |
    `static CodecIdentifier` | `XML_CODEC_IDENTIFIER` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class AbstractCharReplacementEncoder` | `codecIdentifier`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `BasicXMLEncoder ()`
    `protected BasicXMLEncoder (CodecIdentifier codecIdentifier)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected java.lang.Object` | `doEncode(java.lang.Object o)`
    `` | `public final java.lang.Object` | `encode(java.lang.Object o)`
    `` | `protected java.lang.Object` | `encodeAsXmlObject(java.lang.Object o)`
    `` | `protected java.lang.String` | `escapeCharacter(char ch, char previousChar)`
    `` | `protected static final java.lang.String` | `xmlEscapeCharacter(char ch)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractCharReplacementEncoder` | `convertToString, createChainingEncodesToWriter, doCharReplacementEncoding, encode, encodeToStream, encodeToWriter, encodeToWriter, escapeCharSequence, escapeCharacter, getCodecIdentifier, isApplyToSafelyEncoded, isSafe, markEncoded`

- - ### Field Detail

    - #### private static final java.lang.String ESCAPED_AMP

    - #### private static final java.lang.String ESCAPED_APOS

    - #### private static final java.lang.String ESCAPED_AT

    - #### private static final java.lang.String ESCAPED_BACKSLASH

    - #### private static final java.lang.String ESCAPED_BACKTICK

    - #### private static final java.lang.String ESCAPED_GT

    - #### private static final java.lang.String ESCAPED_LINE_SEPARATOR

    - #### private static final java.lang.String ESCAPED_LT

    - #### private static final java.lang.String ESCAPED_NON_BREAKING_SPACE

    - #### private static final java.lang.String ESCAPED_PARAGRAPH_SEPARATOR

    - #### private static final java.lang.String ESCAPED_QUOTE

    - #### private static final char LINE_SEPARATOR

    - #### private static final char NBSP

    - #### private static final char PARAGRAPH_SEPARATOR

    - #### public static final CodecIdentifier XML_CODEC_IDENTIFIER

  - ### Constructor Detail

    - #### public BasicXMLEncoder()

    - #### protected BasicXMLEncoder(CodecIdentifier codecIdentifier)

  - ### Method Detail

    - #### protected java.lang.Object doEncode(java.lang.Object o)

    - #### @java.lang.Override public final java.lang.Object encode(java.lang.Object o)

    - #### protected java.lang.Object encodeAsXmlObject(java.lang.Object o)

    - #### @java.lang.Override protected java.lang.String escapeCharacter(char ch, char previousChar)

    - #### protected static final java.lang.String xmlEscapeCharacter(char ch)