Class XmlEscaper

java.lang.Object
io.jenkins.plugins.xmleditor.core.model.XmlEscaper

public final class XmlEscaper extends Object
Decoding of raw XML text and escaping of new values.
  • Method Details

    • normalizeLineEndings

      public static String normalizeLineEndings(String s)
    • decode

      public static String decode(String raw, Map<String,String> entities, boolean attribute)
      Decodes predefined, character and internal entity references. Unknown entities stay as literal &name;. For attributes, literal whitespace characters are normalized to spaces.
    • escapeText

      public static String escapeText(String value, Predicate<CharSequence> canEncode)
      Escapes a value for element content; characters the file encoding cannot hold become references.
    • escapeAttribute

      public static String escapeAttribute(String value, char quote, Predicate<CharSequence> canEncode)
      Escapes a value for an attribute delimited by quote.