Package: groovy.xml

## [Java] Class MarkupBuilder.DefaultXmlEscapingFunction

- groovy.xml.MarkupBuilder.DefaultXmlEscapingFunction

- All Implemented Interfaces and Traits:
    Function

      public static class MarkupBuilder.DefaultXmlEscapingFunction
      extends Object
      implements Function

  Default character replacement function used for XML content and attribute escaping.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `DefaultXmlEscapingFunction(boolean isAttrValue, boolean useDoubleQuotes)` Creates an escaping function for either element content or attribute values.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Optional<String>` | `apply(Character ch)` Escapes a single character when required by XML output rules.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public DefaultXmlEscapingFunction(boolean isAttrValue, boolean useDoubleQuotes)

      Creates an escaping function for either element content or attribute values.

      Parameters:
        `isAttrValue` - whether the text being escaped is an attribute value
        `useDoubleQuotes` - whether attributes are quoted with double quotes

  - ### Method Detail

    - #### public Optional<String> apply(Character ch)

      Escapes a single character when required by XML output rules.

      Parameters:
        `ch` - the character to inspect
      Returns:
        an escaped replacement, or Optional.empty if no replacement is needed