public final class ContextualAutoescaper extends Object
rewrite
Hello, {$world}!
{/template}Hello, {$world |escapeHtml}!
{/template}| Constructor and Description |
|---|
ContextualAutoescaper(Iterable<String> autoescapeCancellingDirectives,
Map<String,SanitizedContent.ContentKind> sanitizedContentOperators) |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.collect.ImmutableList<SlicedRawTextNode> |
getSlicedRawTextNodes()
Maps ranges of text-nodes to contexts so that later parse passes can add attributes or
elements.
|
Context |
getTemplateEndContext(String templateName)
Null if no typing has been done for the named template, or otherwise the context after a call
to the named template.
|
List<TemplateNode> |
rewrite(SoyFileSetNode fileSet,
TemplateRegistry registry,
ErrorReporter errorReporter)
Rewrites the given Soy files so that dynamic output is properly escaped according to the
context in which it appears.
|
public ContextualAutoescaper(Iterable<String> autoescapeCancellingDirectives, Map<String,SanitizedContent.ContentKind> sanitizedContentOperators)
autoescapeCancellingDirectives - The Soy directives that cancel autoescaping (see
SoyPrintDirective.shouldCancelAutoescape()).sanitizedContentOperators - Maps print directive names to the content kinds they
consume and produce.public List<TemplateNode> rewrite(SoyFileSetNode fileSet, TemplateRegistry registry, ErrorReporter errorReporter)
fileSet - Modified in place.DerivedTemplateUtils for an
explanation of these.public Context getTemplateEndContext(String templateName)
templateName - A qualified template name.public com.google.common.collect.ImmutableList<SlicedRawTextNode> getSlicedRawTextNodes()