List of usage examples for com.google.common.html.types SafeHtmls toProto
public static SafeHtmlProto toProto(SafeHtml safeHtml)
From source file:com.google.template.soy.data.SanitizedContent.java
/** * Converts a Soy {@link SanitizedContent} of kind HTML into a {@link SafeHtmlProto}. * * @throws IllegalStateException if this SanitizedContent's content kind is not * {@link ContentKind#HTML}./*w ww . ja va 2s .co m*/ */ public SafeHtmlProto toSafeHtmlProto() { Preconditions.checkState(getContentKind() == ContentKind.HTML, "toSafeHtmlProto() only valid for SanitizedContent of kind HTML, is: %s", getContentKind()); return SafeHtmls.toProto(UncheckedConversions.safeHtmlFromStringKnownToSatisfyTypeContract(getContent())); }