List of usage examples for com.google.common.html.types SafeStyleSheets toProto
public static SafeStyleSheetProto toProto(SafeStyleSheet style)
From source file:com.google.template.soy.data.SanitizedContent.java
/** * Converts a Soy {@link SanitizedContent} of kind CSS into a {@link SafeStyleSheetProto}. * * <p>To ensure correct behavior and usage, the SanitizedContent object should fulfill the * contract of SafeStyleSheet - the CSS content should represent the top-level content of a style * element within HTML.//from ww w. ja va 2s . c om * * @throws IllegalStateException if this SanitizedContent's content kind is not * {@link ContentKind#CSS}. */ public SafeStyleSheetProto toSafeStyleSheetProto() { Preconditions.checkState(getContentKind() == ContentKind.CSS, "toSafeStyleSheetProto() only valid for SanitizedContent of kind CSS, is: %s", getContentKind()); return SafeStyleSheets.toProto(toSafeStyleSheet()); }