| Package | Description |
|---|---|
| com.google.template.soy.data |
Java representation of Soy data types.
|
| com.google.template.soy.data.ordainers | |
| com.google.template.soy.jbcsrc.api | |
| com.google.template.soy.shared.restricted | |
| com.google.template.soy.tofu |
Java Object backend (a.k.a. Tofu).
|
| Modifier and Type | Method and Description |
|---|---|
static SanitizedContent |
SanitizedContents.concatHtml(SanitizedContent... contents)
Concatenate the contents of multiple
SanitizedContent objects of kind HTML. |
static SanitizedContent |
SanitizedContents.constantHtml(String constant)
Wraps an assumed-safe constant string that specifies a safe, balanced, document fragment.
|
static SanitizedContent |
SanitizedContents.constantUri(String constant)
Wraps an assumed-safe URI constant.
|
static SanitizedContent |
SanitizedContents.emptyString(SanitizedContent.ContentKind kind)
Creates an empty string constant.
|
static SanitizedContent |
LazySanitizedContents.forThunk(RenderableThunk value,
SanitizedContent.ContentKind kind)
Creates a SanitizedContent that wraps the given thunk.
|
static SanitizedContent |
SanitizedContents.fromResource(Class<?> contextClass,
String resourceName,
Charset charset,
SanitizedContent.ContentKind kind)
Loads assumed-safe content from a Java resource.
|
static SanitizedContent |
SanitizedContents.fromResource(String resourceName,
Charset charset,
SanitizedContent.ContentKind kind)
Loads assumed-safe content from a Java resource.
|
static SanitizedContent |
SanitizedContents.fromSafeHtml(com.google.common.html.types.SafeHtml html)
Converts a
SafeHtml into a Soy SanitizedContent of kind HTML. |
static SanitizedContent |
SanitizedContents.fromSafeHtmlProto(com.google.common.html.types.SafeHtmlProto html)
Converts a
SafeHtmlProto into a Soy SanitizedContent of kind HTML. |
static SanitizedContent |
SanitizedContents.fromSafeScript(com.google.common.html.types.SafeScript script)
Converts a
SafeScript into a Soy SanitizedContent of kind JS. |
static SanitizedContent |
SanitizedContents.fromSafeScriptProto(com.google.common.html.types.SafeScriptProto script)
Converts a
SafeScriptProto into a Soy SanitizedContent of kind JS. |
static SanitizedContent |
SanitizedContents.fromSafeStyle(com.google.common.html.types.SafeStyle style)
Converts a
SafeStyle into a Soy SanitizedContent of kind CSS. |
static SanitizedContent |
SanitizedContents.fromSafeStyleProto(com.google.common.html.types.SafeStyleProto style)
Converts a
SafeStyleProto into a Soy SanitizedContent of kind CSS. |
static SanitizedContent |
SanitizedContents.fromSafeStyleSheet(com.google.common.html.types.SafeStyleSheet styleSheet)
Converts a
SafeStyleSheet into a Soy SanitizedContent of kind CSS. |
static SanitizedContent |
SanitizedContents.fromSafeStyleSheetProto(com.google.common.html.types.SafeStyleSheetProto styleSheet)
Converts a
SafeStyleSheetProto into a Soy SanitizedContent of kind CSS. |
static SanitizedContent |
SanitizedContents.fromSafeUrl(com.google.common.html.types.SafeUrl url)
Converts a
SafeUrl into a Soy SanitizedContent of kind URI. |
static SanitizedContent |
SanitizedContents.fromSafeUrlProto(com.google.common.html.types.SafeUrlProto url)
Converts a
SafeUrlProto into a Soy SanitizedContent of kind URI. |
static SanitizedContent |
SanitizedContents.fromTrustedResourceUrl(com.google.common.html.types.TrustedResourceUrl url)
Converts a
TrustedResourceUrl into a Soy SanitizedContent of kind
TRUSTED_RESOURCE_URI. |
static SanitizedContent |
SanitizedContents.fromTrustedResourceUrlProto(com.google.common.html.types.TrustedResourceUrlProto url)
Converts a
TrustedResourceUrlProto into a Soy SanitizedContent of kind
TRUSTED_RESOURCE_URI. |
static SanitizedContent |
UnsafeSanitizedContentOrdainer.ordainAsSafe(String value,
SanitizedContent.ContentKind kind)
Faithfully assumes the provided value is "safe" and marks it not to be re-escaped.
|
static SanitizedContent |
UnsafeSanitizedContentOrdainer.ordainAsSafe(String value,
SanitizedContent.ContentKind kind,
Dir dir)
Faithfully assumes the provided value is "safe" and marks it not to be re-escaped.
|
static SanitizedContent |
SanitizedContents.unsanitizedText(String text)
Creates a SanitizedContent object of kind TEXT and unknown direction.
|
static SanitizedContent |
SanitizedContents.unsanitizedText(String text,
Dir dir)
Creates a SanitizedContent object of kind TEXT of a given direction (null if unknown).
|
| Modifier and Type | Method and Description |
|---|---|
static SanitizedContent |
SanitizedContents.concatHtml(SanitizedContent... contents)
Concatenate the contents of multiple
SanitizedContent objects of kind HTML. |
| Modifier and Type | Method and Description |
|---|---|
static SanitizedContent |
JsIdentifierOrdainer.jsIdentifier(String identifier)
Validates that
identifier matches a safe pattern for JS identifiers and ordains
the value as JS. |
static SanitizedContent |
GsonOrdainer.serializeElement(com.google.gson.JsonElement element)
Serializes a JsonElement to string.
|
static SanitizedContent |
JsonOrdainer.serializeJsonArray(org.json.JSONArray json)
Generate sanitized js content from a JSONArray.
|
static SanitizedContent |
JsonOrdainer.serializeJsonObject(org.json.JSONObject json)
Generate sanitized js content from a JSONObject.
|
static SanitizedContent |
GsonOrdainer.serializeObject(com.google.gson.Gson gson,
Object obj)
Generate sanitized js content with provided Gson serializer.
|
static SanitizedContent |
GsonOrdainer.serializeObject(com.google.gson.Gson gson,
Object obj,
Type type)
Generate sanitized js content with provided Gson serializer and object type.
|
static SanitizedContent |
GsonOrdainer.serializeObject(Object obj)
Generate sanitized js content using a default Gson serializer.
|
| Modifier and Type | Method and Description |
|---|---|
SoySauce.Continuation<SanitizedContent> |
SoySauce.Renderer.renderStrict()
Renders the template to a string.
|
| Modifier and Type | Method and Description |
|---|---|
static SanitizedContent |
Sanitizers.cleanHtml(SoyValue value)
Normalizes the input HTML while preserving "safe" tags and the known directionality.
|
static SanitizedContent |
Sanitizers.cleanHtml(SoyValue value,
Collection<? extends TagWhitelist.OptionalSafeTag> optionalSafeTags)
Normalizes the input HTML while preserving "safe" tags and the known directionality.
|
static SanitizedContent |
Sanitizers.cleanHtml(String value)
Normalizes the input HTML while preserving "safe" tags.
|
static SanitizedContent |
Sanitizers.cleanHtml(String value,
Collection<? extends TagWhitelist.OptionalSafeTag> optionalSafeTags)
Normalizes the input HTML while preserving "safe" tags.
|
static SanitizedContent |
Sanitizers.cleanHtml(String value,
Dir contentDir,
Collection<? extends TagWhitelist.OptionalSafeTag> optionalSafeTags)
Normalizes the input HTML of a given directionality while preserving "safe" tags.
|
static SanitizedContent |
Sanitizers.filterImageDataUri(SoyValue value)
Makes sure that the given input is a data URI corresponding to an image.
|
static SanitizedContent |
Sanitizers.filterImageDataUri(String value)
Makes sure that the given input is a data URI corresponding to an image.
|
| Modifier and Type | Method and Description |
|---|---|
SanitizedContent |
SoyTofu.Renderer.renderStrict()
Renders the strict-mode template as a SanitizedContent object, which can be used as an input
to another Soy template, or used to verify that the output type is correct.
|