@Test public void testEscapeCommonB() { String actual = androidXMLEncoder.escapeCommon("&lt;b&gt;Android&lt;/b&gt;!"); assertEquals("<b>Android</b>!", actual); }
String escapeCommon(String text) { text = escapeDoubleQuotes(text); boolean needsAndroidEscapeHTML = needsAndroidEscapeHTML(text); Matcher matcher = ANDROID_HTML.matcher(text); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, Matcher.quoteReplacement((needsAndroidEscapeHTML ? matcher.group(1) : "<") + matcher.group(2) + unescapeUtils.replaceEscapedQuotes(matcher.group(3)) + ">")); } matcher.appendTail(sb); text = sb.toString(); text = escapeLineFeed(text); text = escapeCariageReturn(text); return text; }
AndroidXMLEncoder extends net.sf.okapi.common.encoder.XMLEncoder { String escapeCommon(String text) { text = escapeDoubleQuotes(text); boolean needsAndroidEscapeHTML = needsAndroidEscapeHTML(text); Matcher matcher = ANDROID_HTML.matcher(text); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, Matcher.quoteReplacement((needsAndroidEscapeHTML ? matcher.group(1) : "<") + matcher.group(2) + unescapeUtils.replaceEscapedQuotes(matcher.group(3)) + ">")); } matcher.appendTail(sb); text = sb.toString(); text = escapeLineFeed(text); text = escapeCariageReturn(text); return text; } }
AndroidXMLEncoder extends net.sf.okapi.common.encoder.XMLEncoder { String escapeCommon(String text) { text = escapeDoubleQuotes(text); boolean needsAndroidEscapeHTML = needsAndroidEscapeHTML(text); Matcher matcher = ANDROID_HTML.matcher(text); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, Matcher.quoteReplacement((needsAndroidEscapeHTML ? matcher.group(1) : "<") + matcher.group(2) + unescapeUtils.replaceEscapedQuotes(matcher.group(3)) + ">")); } matcher.appendTail(sb); text = sb.toString(); text = escapeLineFeed(text); text = escapeCariageReturn(text); return text; } AndroidXMLEncoder(boolean oldEscaping); }
AndroidXMLEncoder extends net.sf.okapi.common.encoder.XMLEncoder { String escapeCommon(String text) { text = escapeDoubleQuotes(text); boolean needsAndroidEscapeHTML = needsAndroidEscapeHTML(text); Matcher matcher = ANDROID_HTML.matcher(text); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, Matcher.quoteReplacement((needsAndroidEscapeHTML ? matcher.group(1) : "<") + matcher.group(2) + unescapeUtils.replaceEscapedQuotes(matcher.group(3)) + ">")); } matcher.appendTail(sb); text = sb.toString(); text = escapeLineFeed(text); text = escapeCariageReturn(text); return text; } AndroidXMLEncoder(boolean oldEscaping); @Override String encode(String text, EncoderContext context); String escapeAndroid(String text); String escapeAndroidOld(String text); }
AndroidXMLEncoder extends net.sf.okapi.common.encoder.XMLEncoder { String escapeCommon(String text) { text = escapeDoubleQuotes(text); boolean needsAndroidEscapeHTML = needsAndroidEscapeHTML(text); Matcher matcher = ANDROID_HTML.matcher(text); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, Matcher.quoteReplacement((needsAndroidEscapeHTML ? matcher.group(1) : "<") + matcher.group(2) + unescapeUtils.replaceEscapedQuotes(matcher.group(3)) + ">")); } matcher.appendTail(sb); text = sb.toString(); text = escapeLineFeed(text); text = escapeCariageReturn(text); return text; } AndroidXMLEncoder(boolean oldEscaping); @Override String encode(String text, EncoderContext context); String escapeAndroid(String text); String escapeAndroidOld(String text);  }