gpt4 book ai didi

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

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

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

XMLUtils.escape介绍

[英]If there is a suitable entity reference for this character, return it. The list of available entity references is almost but not identical between XML and HTML. This uses a default transformation policy of replacing invalid XML characters.
[中]如果此字符有合适的实体引用,请将其返回。XML和HTML之间可用实体引用的列表几乎相同,但并不相同。这将使用替换无效XML字符的默认转换策略。

代码示例

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

public String xmlEscape(final String text)
  {
    return XMLUtils.escape(text);
  }
}

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

/**
 * If there is a suitable entity reference for this character, return it. The list of available entity references is
 * almost but not identical between XML and HTML. This uses a default transformation policy of replacing invalid XML
 * characters.
 *
 * @since 6.0
 */
public static String escape(final int codePoint) {
  return escape(codePoint, DEFAULT_POLICY);
}

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

/**
 * Escape an XML string using a default policy of replacing invalid XML characters.
 */
public static String escape(final String source)
{
  return escape(source, DEFAULT_POLICY);
}

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

/**
 * If there is a suitable entity reference for this character, return it. The list of available entity references is
 * almost but not identical between XML and HTML. This uses a default transformation policy of replacing invalid XML
 * characters.
 */
public static String escape(final char ch)
{
  return escape(ch, DEFAULT_POLICY);
}

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

/**
 * Escape an XML string using a default policy of replacing invalid XML characters.
 */
public static String escape(final String source) {
  return escape(source, DEFAULT_POLICY);
}

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

/**
 * If there is a suitable entity reference for this character, return it. The list of available entity references is
 * almost but not identical between XML and HTML. This uses a default transformation policy of replacing invalid XML
 * characters.
 *
 * @deprecated use {@link com.atlassian.core.util.XMLUtils#escape(int)} instead
 */
@Deprecated
public static String escape(final char ch) {
  return escape(ch, DEFAULT_POLICY);
}

代码示例来源:origin: com.atlassian.confluence.plugins/confluence-software-blueprints

public String getCreateFromTemplateMacro(BlueprintContext context, String buttonLabel, String pluginKey) {
  String spaceKey = XMLUtils.escape(context.getSpaceKey());
  String blueprintKey = XMLUtils.escape(context.getBlueprintModuleCompleteKey().getCompleteKey());
  HashMap<String, Object> templateContext = Maps.newHashMap();
  templateContext.put("blueprintKey", blueprintKey);
  templateContext.put("spaceKey", spaceKey);
  templateContext.put("buttonLabel", buttonLabel);
  return renderFromSoy(pluginKey, CREATE_FROM_TEMPLATE_MACRO, templateContext);
}

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

public void writeIssue(Issue issue, AbstractIssueView issueView, Writer writer) throws IOException
  {
    if(log.isDebugEnabled())
    {
      log.debug("About to write RSS view for issue [" + issue.getKey() + "].");
    }
    Map bodyParams = JiraVelocityUtils.getDefaultVelocityParams(authenticationContext);
    String htmlBody = issueView.getBody(issue, searchRequestParams);
    bodyParams.put("issue", issue);
    bodyParams.put("issueDescription", XMLUtils.escape(styleSheet + " " + htmlBody));
    String body = descriptor.getHtml("view", bodyParams);
    writer.write(body);
  }
};

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

private void writeDummyXMLResponse(final HttpServletResponse response) throws IOException
{
  response.setContentType("text/xml");
  final String baseUrl = velocityRequestContextFactory.getJiraVelocityRequestContext().getBaseUrl();
  final StringBuilder sb = new StringBuilder();
  sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n\n");
  sb.append("<!--  RSS generated by JIRA ").append(buildUtilsInfo.getVersion()).append(" at ").append(dateTimeFormatterFactory.formatter().withStyle(DateTimeStyle.RSS_RFC822_DATE_TIME).withSystemZone().format(new Date())).append(
    " -->\n");
  sb.append("<rss version=\"0.92\">\n");
  sb.append("<channel>\n");
  sb.append("\t<title>").append(XMLUtils.escape(applicationProperties.getString(APKeys.JIRA_TITLE))).append("</title>\n");
  sb.append("\t<link>").append(XMLUtils.escape(baseUrl)).append("</link>\n");
  sb.append("\t<description>").append(XMLUtils.escape(i18n.getInstance(authenticationContext.getLocale()).getText("issue.views.xml.some.desc"))).append("</description>\n");
  final String rssLocale = RssViewUtils.getRssLocale(authenticationContext.getLocale());
  if (rssLocale != null)
  {
    sb.append("\t<language>").append(rssLocale).append("</language>\n");
  }
  sb.append("<build-info>");
  sb.append("\t<version>").append(XMLUtils.escape(buildUtilsInfo.getVersion())).append("</version>");
  sb.append("\t<build-number>").append(XMLUtils.escape(buildUtilsInfo.getCurrentBuildNumber())).append("</build-number>");
  sb.append("\t<build-date>").append(XMLUtils.escape(new SimpleDateFormat("dd-MM-yyyy").format(buildUtilsInfo.getCurrentBuildDate()))).append("</build-date>");
  sb.append("</build-info>");
  sb.append("</channel>\n");
  sb.append("</rss>\n");
  final PrintWriter out = response.getWriter();
  out.write(sb.toString());
  out.flush();
}

代码示例来源:origin: com.atlassian.confluence.plugins/confluence-software-blueprints

@Override
protected BlueprintContext updateBlueprintContext(BlueprintContext context) {
  String spaceKey = XMLUtils.escape(context.getSpaceKey());
  String blueprintKey = XMLUtils.escape(context.getBlueprintModuleCompleteKey().getCompleteKey());
  context.put("createFromTemplateMacro", getCreateFromTemplateMacro(blueprintKey, spaceKey));
  return context;
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin

throw new ResponseException(String.format("Failed to parse FishEye response: %s", XMLUtils.escape(e.getMessage())), e);

代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin

throw new ResponseException(String.format("Failed to parse FishEye response: %s", XMLUtils.escape(e.getMessage())), e);

代码示例来源:origin: com.atlassian.confluence.plugins/confluence-business-blueprints

String faviconImg = String.format("<img src=\"%s\" height=\"16px\"/>", XMLUtils.escape(faviconURL));
context.put("faviconImg", faviconImg);
    XMLUtils.escape(meta.getSourceURL()),
    XMLUtils.escape(meta.getExcerptedURL()));
context.put("htmlLink", htmlLink);

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