/** * Creates a stamper that will be use the given token, which is assumed * to be unique and will be escaped before being used. */ public RenderableStamper(String token) { this.token = SafeHtmlUtils.htmlEscape(token); }
/** * Escape a string. * * @param s the string to escape */ private String escape(String s) { return SafeHtmlUtils.htmlEscape(s); }
/** * Appends the string representation of a char. * * @param c the character whose string representation to append * @return a reference to this object * @see SafeHtmlUtils#htmlEscape(char) */ public SafeHtmlBuilder append(char c) { sb.append(SafeHtmlUtils.htmlEscape(c)); return this; }
/** * Appends a string after HTML-escaping it. * * @param text the string to append * @return a reference to this object * @see SafeHtmlUtils#htmlEscape(String) */ public SafeHtmlBuilder appendEscaped(String text) { sb.append(SafeHtmlUtils.htmlEscape(text)); return this; }
/** * Appends a string consisting of several newline-separated lines after * HTML-escaping it. Newlines in the original string are converted to {@code * <br>} tags. * * @param text the string to append * @return a reference to this object * @see SafeHtmlUtils#htmlEscape(String) */ public SafeHtmlBuilder appendEscapedLines(String text) { sb.append(SafeHtmlUtils.htmlEscape(text).replaceAll("\n", "<br>")); return this; }
/** * Returns a {@link SafeHtml} containing the escaped string. * * @param s the input String * @return a {@link SafeHtml} instance */ public static SafeHtml fromString(String s) { return new SafeHtmlString(htmlEscape(s)); }
/** * A convenience method to set default suggestions using plain text strings. * * Note to use this method each default suggestion must be plain text. * * @param suggestionList the default list of suggestions */ public final void setDefaultSuggestionsFromText( Collection<String> suggestionList) { Collection<Suggestion> accum = new ArrayList<Suggestion>(); for (String candidate : suggestionList) { accum.add(createSuggestion(candidate, SafeHtmlUtils.htmlEscape(candidate))); } setDefaultSuggestions(accum); }
escaped.append(htmlEscape(segment)); continue; escaped.append(htmlEscape(segment.substring(entityEnd + 1))); } else { escaped.append("&").append(htmlEscape(segment));
String origStr = str; if (!isHtml) { str = SafeHtmlUtils.htmlEscape(str);
/** * Creates a stamper that will be use the given token, which is assumed * to be unique and will be escaped before being used. */ public RenderableStamper(String token) { this.token = SafeHtmlUtils.htmlEscape(token); }
/** * Creates a stamper that will be use the given token, which is assumed * to be unique and will be escaped before being used. */ public RenderableStamper(String token) { this.token = SafeHtmlUtils.htmlEscape(token); }
/** * Escape a string. * * @param s the string to escape */ private String escape(String s) { return SafeHtmlUtils.htmlEscape(s); }
/** * Appends the string representation of a char. * * @param c the character whose string representation to append * @return a reference to this object * @see SafeHtmlUtils#htmlEscape(char) */ public SafeHtmlBuilder append(char c) { sb.append(SafeHtmlUtils.htmlEscape(c)); return this; }
attributes.append("accessKey=\"").append(SafeHtmlUtils.htmlEscape("" + accessKey)); attributes.append("\" ");
/** * {@inheritDoc} */ public void setText(String text) { setHTML(SafeHtmlUtils.htmlEscape(text)); }
/** * Returns a {@link SafeHtml} containing the escaped string. * * @param s the input String * @return a {@link SafeHtml} instance */ public static SafeHtml fromString(String s) { return new SafeHtmlString(htmlEscape(s)); }
public SafeHtml createDivStart(String title, String defaultValue, String cssClasses) { if (title == null || "".equals(title)) { title = defaultValue; } final String css = cssClasses == null ? "" : "class=\"" + cssClasses + "\""; return SafeHtmlUtils.fromTrustedString("<div title=\"" + SafeHtmlUtils.htmlEscape(title.trim()) + "\" " + css + " >"); }
/** * Processes the element body using Prettify filter. */ @Override public void compile(JQElement element, JSON attrs) { String text = SafeHtmlUtils.htmlEscape(element.text()); element.empty().append(prettifier.prettify(text)); } }
public static ProjectConcurrentChangePopup newConcurrentChange( final Path project, final User identity, final Command onIgnore, final Command onReOpen ) { final String message = ProjectConcurrentChangePopupConstants.INSTANCE.ConcurrentChange( identity != null ? SafeHtmlUtils.htmlEscape( identity.getIdentifier() != null ? identity.getIdentifier() : "" ) : null, project.toURI() ); return new ProjectConcurrentChangePopup( message, onIgnore, onReOpen ); }
public InlineLink(String title) { super("<a href='javascript:void(0)' aria-label='"+ SafeHtmlUtils.htmlEscape(title)+"' style='vertical-align:bottom;'>"+title+"</a>"); getElement().setTabIndex(0); this.sinkEvents(Event.ONKEYDOWN); this.sinkEvents(Event.ONMOUSEDOWN); addStyleName("inline-link"); }