org.apache.commons.lang.StringEscapeUtils.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(121)

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

StringEscapeUtils.<init>介绍

[英]StringEscapeUtils instances should NOT be constructed in standard programming.

Instead, the class should be used as:

StringEscapeUtils.escapeJava("foo");

This constructor is public to permit tools that require a JavaBean instance to operate.
[中]

代码示例

代码示例来源:origin: stackoverflow.com

StringEscapeUtils strutil  =  new StringEscapeUtils();
title =    strutil.escapeHtml(title);

代码示例来源:origin: epimorphics/elda

/** Add generic tools to the Velocity context */
protected void addTools( VelocityContext vc ) {
  vc.put( "esc", new StringEscapeUtils() );
  vc.put( "log", log );
}

代码示例来源:origin: org.motechproject/motech-platform-decisiontree

private ModelAndView constructModelViewForNode(HttpServletRequest request, Node node, String transitionPath, String[] treeNames, Map<String, Object> params, FlowSession session) {
  validateNode(node);
  treeEventProcessor.sendActionsBefore(node, transitionPath, params);
  ModelAndView mav = new ModelAndView();
  if (node.getTransitions().size() > 0) {
    mav.addObject("treeName", request.getParameter(TREE_NAME_PARAM));
  } else { // leaf
    //reduce the current tree and redirect to the next tree
    mav.addObject("treeName", StringUtils.join(ArrayUtils.remove(treeNames, 0), TREE_NAME_SEPARATOR));
  }
  mav.setViewName(templateNameFor(request.getParameter(PROVIDER_NAME_PARAM), NODE_TEMPLATE_NAME));
  mav.addObject("contextPath", request.getContextPath());
  mav.addObject("servletPath", request.getServletPath());
  mav.addObject("node", node);
  mav.addObject("language", session.get(LANGUAGE_PARAM));
  mav.addObject("provider", request.getParameter(PROVIDER_NAME_PARAM));
  mav.addObject("transitionPath", Base64.encodeBase64URLSafeString(transitionPath.getBytes()));
  mav.addObject("escape", new StringEscapeUtils());
  mav.addObject("maxDigits", maxDigits(node));
  mav.addObject("maxTimeout", maxTimeout(node));
  mav.addObject("host", request.getHeader("Host"));
  mav.addObject("scheme", request.getScheme());
  session.setCurrentNode(node);
  return mav;
}

代码示例来源:origin: org.motechproject/motech-decisiontree-server

private ModelAndView constructModelViewForNode(Node node, FlowSession session, String provider, String tree) {
  treeEventProcessor.sendActionsBefore(node, new HashMap<String, Object>());
  ModelAndView mav = new ModelAndView();
  mav.setViewName(templateNameFor(provider, NODE_TEMPLATE_NAME));
  mav.addObject("treeName", tree);
  mav.addObject("node", node);
  mav.addObject("provider", provider);
  mav.addObject("language", session.getLanguage());
  mav.addObject("escape", new StringEscapeUtils());
  mav.addObject("maxDigits", maxDigits(node));
  mav.addObject("maxTimeout", maxTimeout(node));
  mav.addObject("transitionKeyEndMarker", transitionKeyEndMarker(node));
  mav.addObject("isUserInputNeeded", isUserInputNeeded(node));
  session.setCurrentNode(node);
  return mav;
}

代码示例来源:origin: org.motechproject/motech-callflow

private ModelAndView constructModelViewForNode(Node node, FlowSession session, String provider, String tree) {
  Map<String, Object> params = new HashMap<String, Object>();
  params.put(FLOW_SESSION_ID_FIELD, session.getSessionId());
  treeEventProcessor.sendActionsBefore(node, params);
  ModelAndView mav = new ModelAndView();
  mav.setViewName(templateNameFor(provider, NODE_TEMPLATE_NAME));
  mav.addObject("treeName", tree);
  mav.addObject("node", node);
  mav.addObject("provider", provider);
  mav.addObject("language", session.getLanguage());
  mav.addObject("escape", new StringEscapeUtils());
  mav.addObject("maxDigits", maxDigits(node));
  mav.addObject("maxTimeout", maxTimeout(node));
  mav.addObject("transitionKeyEndMarker", transitionKeyEndMarker(node));
  mav.addObject("isUserInputNeeded", isUserInputNeeded(node));
  session.setCurrentNode(node);
  return mav;
}

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

velocityParameters.put("suggestedLabels", getLabelSuggestion(null != issue ? issue.getId() : null, field, 100));
velocityParameters.put("stringEscapeUtils", new StringEscapeUtils());
velocityParameters.put("stringUtils", new StringUtils());
velocityParameters.put("searchService", searchService);

相关文章