public class NodeContentKinds extends Object
kind attribute on {param} nodes.
This attribute specifies the SanitizedContent.ContentKind that the content of the node will evaluate to,
and in turn determines the HTML context to use when contextually autoescaping the node's content
(see
com.google.template.soy.parsepasses.contextautoesc.Context#forContentKind(ContentKind)).
| Modifier and Type | Method and Description |
|---|---|
static SanitizedContent.ContentKind |
forAttributeValue(String attributeValue)
Given an allowed value of the attribute, returns the corresponding
SanitizedContent.ContentKind). |
static Set<String> |
getAttributeValues()
The set of permitted values of the
kind attribute. |
static String |
toAttributeValue(SanitizedContent.ContentKind kind)
Given a ContentKind, returns the attribute string.
|
static String |
toIDOMSanitizedContentCtorName(SanitizedContent.ContentKind contentKind)
Given a
SanitizedContent.ContentKind, returns the corresponding JS SanitizedContent constructor. |
static String |
toJsSanitizedContentCtorName(SanitizedContent.ContentKind contentKind)
Given a
SanitizedContent.ContentKind, returns the corresponding JS SanitizedContent constructor. |
static String |
toJsSanitizedContentOrdainer(SanitizedContent.ContentKind contentKind)
Given a
SanitizedContent.ContentKind, returns the corresponding JS SanitizedContent factory function. |
static String |
toJsSanitizedContentOrdainerForInternalBlocks(SanitizedContent.ContentKind contentKind)
Returns the ordainer function for param and let blocks, which behaves subtly differently than
the normal ordainers to ease migration.
|
static String |
toPySanitizedContentOrdainer(SanitizedContent.ContentKind contentKind)
Given a
SanitizedContent.ContentKind, returns the corresponding Python sanitize class. |
public static SanitizedContent.ContentKind forAttributeValue(String attributeValue)
SanitizedContent.ContentKind).public static String toAttributeValue(SanitizedContent.ContentKind kind)
public static Set<String> getAttributeValues()
kind attribute.public static String toJsSanitizedContentCtorName(SanitizedContent.ContentKind contentKind)
SanitizedContent.ContentKind, returns the corresponding JS SanitizedContent constructor.
These constructors may not be directly instantiated -- instead, an "ordainer" function is
used. This is so that Soy developers have to jump through extra hoops and carefully think
about the implications of directly calling the SanitizedContent constructors.public static String toIDOMSanitizedContentCtorName(SanitizedContent.ContentKind contentKind)
SanitizedContent.ContentKind, returns the corresponding JS SanitizedContent constructor.
This functions similarly to toJsSanitizedContentCtorName(com.google.template.soy.data.SanitizedContent.ContentKind), but
replaces HTML and Attribute types with Function instead of their sanitized types since
in Incremental DOM, the HTML types are actually functions that are invoked.public static String toJsSanitizedContentOrdainer(SanitizedContent.ContentKind contentKind)
SanitizedContent.ContentKind, returns the corresponding JS SanitizedContent factory function.public static String toJsSanitizedContentOrdainerForInternalBlocks(SanitizedContent.ContentKind contentKind)
public static String toPySanitizedContentOrdainer(SanitizedContent.ContentKind contentKind)
SanitizedContent.ContentKind, returns the corresponding Python sanitize class.