public final class NodeContentKinds extends Object
kind attribute on {param} nodes.
This attribute specifies the SanitizedContentKind 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(SanitizedContentKind)).
TODO(lukes): delete this class, move the backend specific functionality into the backends
| Modifier and Type | Method and Description |
|---|---|
static String |
getJsImportForOrdainersFunctions(SanitizedContentKind contentKind)
Returns the namespace to
goog.require to access the ordainer functions provided by
toJsSanitizedContentOrdainer(SanitizedContentKind) and toJsSanitizedContentOrdainerForInternalBlocks(SanitizedContentKind). |
static String |
toIDOMSanitizedContentCtorName(SanitizedContentKind contentKind)
Given a
SanitizedContentKind, returns the corresponding JS SanitizedContent
constructor. |
static String |
toJsPackFunction(com.google.protobuf.Descriptors.Descriptor protoDescriptor)
Returns the pack function for converting SanitizedContent objects to safe protos.
|
static String |
toJsSanitizedContentCtorName(SanitizedContentKind contentKind)
Given a
SanitizedContentKind, returns the corresponding JS SanitizedContent
constructor. |
static String |
toJsSanitizedContentOrdainer(SanitizedContentKind contentKind)
Given a
SanitizedContentKind, returns the corresponding JS SanitizedContent factory
function. |
static String |
toJsSanitizedContentOrdainerForInternalBlocks(SanitizedContentKind contentKind)
Returns the ordainer function for param and let blocks, which behaves subtly differently than
the normal ordainers to ease migration.
|
static String |
toJsUnpackFunction(com.google.protobuf.Descriptors.Descriptor protoDescriptor)
Returns the unpack function for converting safe protos to JS SanitizedContent.
|
static String |
toPySanitizedContentOrdainer(SanitizedContentKind contentKind)
Given a
SanitizedContentKind, returns the corresponding Python sanitize class. |
public static String toJsSanitizedContentCtorName(SanitizedContentKind contentKind)
SanitizedContentKind, 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(SanitizedContentKind contentKind)
SanitizedContentKind, returns the corresponding JS SanitizedContent
constructor.
This functions similarly to toJsSanitizedContentCtorName(com.google.template.soy.base.internal.SanitizedContentKind), 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(SanitizedContentKind contentKind)
SanitizedContentKind, returns the corresponding JS SanitizedContent factory
function.public static String toJsSanitizedContentOrdainerForInternalBlocks(SanitizedContentKind contentKind)
public static String getJsImportForOrdainersFunctions(SanitizedContentKind contentKind)
goog.require to access the ordainer functions provided by
toJsSanitizedContentOrdainer(SanitizedContentKind) and toJsSanitizedContentOrdainerForInternalBlocks(SanitizedContentKind).contentKind - public static String toJsPackFunction(com.google.protobuf.Descriptors.Descriptor protoDescriptor)
public static String toJsUnpackFunction(com.google.protobuf.Descriptors.Descriptor protoDescriptor)
public static String toPySanitizedContentOrdainer(SanitizedContentKind contentKind)
SanitizedContentKind, returns the corresponding Python sanitize class.