gpt4 book ai didi

com.atlassian.core.util.XMLUtils.transform()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 21:23:05 36 4
gpt4 key购买 nike

本文整理了Java中com.atlassian.core.util.XMLUtils.transform()方法的一些代码示例,展示了XMLUtils.transform()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLUtils.transform()方法的具体详情如下:
包路径:com.atlassian.core.util.XMLUtils
类名称:XMLUtils
方法名:transform

XMLUtils.transform介绍

[英]Append escaped version of character to the end of the StringBuilder
[中]将转义版本的字符附加到StringBuilder的末尾

代码示例

代码示例来源:origin: com.atlassian.core/atlassian-core-xml

/**
 * Escape XML characters with a user specified transformation policy for invalid characters.
 *
 * @since 3.19 / 3.10.1
 */
public static String escape(final char ch, final TransformPolicy policy)
{
  final StringBuilder sb = new StringBuilder();
  transform(sb, ch, policy);
  return sb.toString();
}

代码示例来源:origin: com.atlassian.core/atlassian-core

/**
 * Escape XML character with a user specified transformation policy for invalid characters.
 *
 * @since 6.0
 */
public static String escape(final int codePoint, final TransformPolicy policy) {
  final StringBuilder sb = new StringBuilder();
  transform(sb, codePoint, policy);
  return sb.toString();
}

代码示例来源:origin: com.atlassian.core/atlassian-core

/**
 * Escape XML characters with a user specified transformation policy for invalid characters.
 *
 * @deprecated use {@link com.atlassian.core.util.XMLUtils#escape(int, TransformPolicy)} instead
 * @since 3.19 / 3.10.1
 */
@Deprecated
public static String escape(final char ch, final TransformPolicy policy) {
  final StringBuilder sb = new StringBuilder();
  transform(sb, ch, policy);
  return sb.toString();
}

代码示例来源:origin: com.atlassian.core/atlassian-core-xml

/**
 * Escapes a string so it may be returned as text content or attribute value. Non printable characters are escaped
 * using character references. Where the format specifies a deault entity reference, that reference is used (e.g.
 * <tt>&amp;lt;</tt>).
 *
 * @param source the string to escape or "" for null.
 * @param policy how to handle invalid XML characters
 * @since 3.19 / 3.10.1
 */
public static String escape(final String source, final TransformPolicy policy)
{
  if (source == null)
  {
    return "";
  }
  StringBuilder sb = new StringBuilder(source.length() + 30);  // lets allocate a StringBuilder that is roughly the same length
  for (int i = 0; i < source.length(); ++i)
  {
    transform(sb, source.charAt(i), policy);
  }
  return sb.toString();
}

代码示例来源:origin: com.atlassian.core/atlassian-core

/**
 * Escapes a string so it may be returned as text content or attribute value. Non printable characters are escaped
 * using character references. Where the format specifies a deault entity reference, that reference is used (e.g.
 * <tt>&amp;lt;</tt>).
 *
 * @param source the string to escape or "" for null.
 * @param policy how to handle invalid XML characters
 * @since 3.19 / 3.10.1
 */
public static String escape(final String source, final TransformPolicy policy) {
  if (source == null) {
    return "";
  }
  StringBuilder sb = new StringBuilder(source.length() + 30);  // lets allocate a StringBuilder that is roughly the same length
  source.codePoints().forEach(codePoint -> transform(sb, codePoint, policy));
  return sb.toString();
}

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com