@ParametersAreNonnullByDefault @Immutable public abstract class SanitizedContent extends SoyData implements SoyString
| Modifier and Type | Class and Description |
|---|---|
static class |
SanitizedContent.ContentKind
A kind of textual content.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
coerceToBoolean()
Coerces this value into a boolean.
|
String |
coerceToString()
Coerces this value into a string.
|
boolean |
equals(Object other)
Compares this value against another for equality in the sense of the '==' operator of Soy.
|
abstract String |
getContent()
Returns a string of valid content with kind
getContentKind(). |
Dir |
getContentDirection()
Returns the content's direction; null indicates that the direction is unknown, and is to be
estimated when necessary.
|
SanitizedContent.ContentKind |
getContentKind()
Returns the kind of content.
|
int |
hashCode() |
String |
stringValue()
Returns the string value.
|
com.google.common.html.types.SafeHtml |
toSafeHtml()
Converts a Soy
SanitizedContent of kind HTML into a SafeHtml. |
com.google.common.html.types.SafeHtmlProto |
toSafeHtmlProto()
Converts a Soy
SanitizedContent of kind HTML into a SafeHtmlProto. |
com.google.common.html.types.SafeScriptProto |
toSafeScriptProto()
Converts a Soy
SanitizedContent of kind JS into a SafeScriptProto. |
com.google.common.html.types.SafeStyleProto |
toSafeStyleProto()
Converts a Soy
SanitizedContent of kind CSS into a SafeStyleProto. |
com.google.common.html.types.SafeStyleSheet |
toSafeStyleSheet()
Converts a Soy
SanitizedContent of kind CSS into a SafeStyleSheet. |
com.google.common.html.types.SafeStyleSheetProto |
toSafeStyleSheetProto()
Converts a Soy
SanitizedContent of kind CSS into a SafeStyleSheetProto. |
com.google.common.html.types.SafeUrlProto |
toSafeUrlProto()
Converts a Soy
SanitizedContent of kind URI into a SafeUrlProto. |
String |
toString() |
com.google.common.html.types.TrustedResourceUrlProto |
toTrustedResourceUrlProto()
Converts a Soy
SanitizedContent of kind TRUSTED_RESOURCE_URI into a TrustedResourceUrlProto. |
createFromExistingDatabooleanValue, floatValue, integerValue, longValue, numberValue, render, renderAndResolve, resolve, statusclone, finalize, getClass, notify, notifyAll, wait, wait, waitbooleanValue, floatValue, integerValue, longValue, numberValue, render, renderrenderAndResolve, resolve, statuspublic abstract String getContent()
getContentKind().public final SanitizedContent.ContentKind getContentKind()
@Nullable public Dir getContentDirection()
public boolean coerceToBoolean()
SoyValuecoerceToBoolean in interface SoyValuepublic String coerceToString()
SoyValuecoerceToString in interface SoyValuepublic String stringValue()
In contexts where a string value is required, SanitizedContent is permitted.
stringValue in interface SoyValuestringValue in class SoyAbstractValuepublic boolean equals(@Nullable Object other)
SoyValueequals in interface SoyValueequals in class SoyAbstractValueother - The other value to compare against.public com.google.common.html.types.SafeHtml toSafeHtml()
SanitizedContent of kind HTML into a SafeHtml.IllegalStateException - if this SanitizedContent's content kind is not SanitizedContent.ContentKind.HTML.public com.google.common.html.types.SafeHtmlProto toSafeHtmlProto()
SanitizedContent of kind HTML into a SafeHtmlProto.IllegalStateException - if this SanitizedContent's content kind is not SanitizedContent.ContentKind.HTML.public com.google.common.html.types.SafeScriptProto toSafeScriptProto()
SanitizedContent of kind JS into a SafeScriptProto.IllegalStateException - if this SanitizedContent's content kind is not SanitizedContent.ContentKind.JS.public com.google.common.html.types.SafeStyleProto toSafeStyleProto()
SanitizedContent of kind CSS into a SafeStyleProto.IllegalStateException - if this SanitizedContent's content kind is not SanitizedContent.ContentKind.CSS.public com.google.common.html.types.SafeStyleSheet toSafeStyleSheet()
SanitizedContent of kind CSS into a SafeStyleSheet.
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.
IllegalStateException - if this SanitizedContent's content kind is not SanitizedContent.ContentKind.CSS.public com.google.common.html.types.SafeStyleSheetProto toSafeStyleSheetProto()
SanitizedContent of kind CSS into a SafeStyleSheetProto.
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.
IllegalStateException - if this SanitizedContent's content kind is not SanitizedContent.ContentKind.CSS.public com.google.common.html.types.SafeUrlProto toSafeUrlProto()
SanitizedContent of kind URI into a SafeUrlProto.IllegalStateException - if this SanitizedContent's content kind is not SanitizedContent.ContentKind.URI.public com.google.common.html.types.TrustedResourceUrlProto toTrustedResourceUrlProto()
SanitizedContent of kind TRUSTED_RESOURCE_URI into a TrustedResourceUrlProto.IllegalStateException - if this SanitizedContent's content kind is not SanitizedContent.ContentKind.TRUSTED_RESOURCE_URI.