org.apache.commons.text.StringEscapeUtils.escapeHtml3()方法的使用及代码示例

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

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

StringEscapeUtils.escapeHtml3介绍

暂无

代码示例

代码示例来源:origin: org.apache.commons/commons-text

@Test
public void testEscapeHtmlThree() {
  assertNull(StringEscapeUtils.escapeHtml3(null));
  assertEquals("a", StringEscapeUtils.escapeHtml3("a"));
  assertEquals("&lt;b&gt;a", StringEscapeUtils.escapeHtml3("<b>a"));
}

代码示例来源:origin: dhis2/dhis2-core

String optionComboName = categoryOptionCombo != null ? escapeHtml3( categoryOptionCombo.getName() ) : "[ " + i18n.getString( "cat_option_combo_not_exist" ) + " ]";
    append( escapeHtml3( dataElement.getDisplayName() ) ).append( " - " ).append( optionComboId ).append( " - " ).
    append( optionComboName ).append( " - " ).append( dataElement.getValueType() ).append( "\"" ) : new StringBuilder();
displayValue = dataElement != null ? "value=\"[ " + escapeHtml3( dataElement.getDisplayName() ) + " " + optionComboName + " ]\"" : "[ " + i18n.getString( "data_element_not_exist" ) + " ]";
displayTitle = dataElement != null ? title.toString() : "[ " + i18n.getString( "dataelement_not_exist" ) + " ]";
DataElement dataElement = dataElementService.getDataElement( dataElementId );
displayValue = dataElement != null ? "value=\"[ " + escapeHtml3( dataElement.getDisplayName() ) + " ]\"" : "[ " + i18n.getString( "data_element_not_exist" ) + " ]";
displayTitle = dataElement != null ? "title=\"" + escapeHtml3( dataElement.getDisplayName() ) + "\"" : "[ " + i18n.getString( "data_element_not_exist" ) + " ]";
Indicator indicator = indicatorService.getIndicator( indicatorId );
displayValue = indicator != null ? "value=\"[ " + escapeHtml3( indicator.getDisplayName() ) + " ]\"" : "[ " + i18n.getString( "indicator_not_exist" ) + " ]";
displayTitle = indicator != null ? "title=\"" + escapeHtml3( indicator.getDisplayName() ) + "\"" : "[ " + i18n.getString( "indicator_not_exist" ) + " ]";

代码示例来源:origin: dhis2/dhis2-core

String titleTag = " title=\"" + escapeHtml3( dataElement.getDisplayDescription() ) + "\" ";
inputHtml = inputHtml.replaceAll( "title=\".*?\"", "" ).replace( TAG_CLOSE, titleTag + TAG_CLOSE );

相关文章