@Singleton public class EscapeHtmlDirective extends Object implements SoyJavaPrintDirective, SoyJsSrcPrintDirective, SoyPySrcPrintDirective, ShortCircuitable
| Constructor and Description |
|---|
EscapeHtmlDirective() |
| Modifier and Type | Method and Description |
|---|---|
SoyValue |
applyForJava(SoyValue value,
List<SoyValue> args)
Applies this directive on the given value.
|
JsExpr |
applyForJsSrc(JsExpr value,
List<JsExpr> args)
Applies this directive on the given string value.
|
PyExpr |
applyForPySrc(PyExpr value,
List<PyExpr> args)
Applies this directive on the given string value.
|
String |
getName()
Gets the name of the Soy print directive.
|
Set<Integer> |
getValidArgsSizes()
Gets the set of valid args list sizes.
|
boolean |
isNoopForKind(SanitizedContent.ContentKind kind)
Returns true if this directive will turn into a no-op when passed values of the given content
kind.
|
boolean |
shouldCancelAutoescape()
Returns whether the appearance of this directive on a 'print' tag should cancel autoescape for
that 'print' tag.
|
public static final String NAME
public String getName()
SoyPrintDirectivegetName in interface SoyPrintDirectivepublic Set<Integer> getValidArgsSizes()
SoyPrintDirectivegetValidArgsSizes in interface SoyPrintDirectivepublic boolean shouldCancelAutoescape()
SoyPrintDirectiveshouldCancelAutoescape in interface SoyPrintDirectivepublic boolean isNoopForKind(SanitizedContent.ContentKind kind)
ShortCircuitableisNoopForKind in interface ShortCircuitablepublic SoyValue applyForJava(SoyValue value, List<SoyValue> args)
SoyJavaPrintDirectiveapplyForJava in interface SoyJavaPrintDirectivevalue - The input to the directive. This is not necessarily a string. If a directive
only applies to string inputs, then it should first call coerceToString() on this
input value.args - The directive's arguments, if any (often none).StringData or SanitizedContent.public JsExpr applyForJsSrc(JsExpr value, List<JsExpr> args)
SoyJsSrcPrintDirective Important note when implementing this method: The string value may not yet have been
coerced to a string. You may need to explicitly coerce it to a string using the JS function
String().
applyForJsSrc in interface SoyJsSrcPrintDirectivevalue - The value to apply the directive on. This value may not yet have been
coerced to a string.args - The directive's arguments, if any (usually none).public PyExpr applyForPySrc(PyExpr value, List<PyExpr> args)
SoyPySrcPrintDirective Important note when implementing this method: The string value may not yet have been
coerced to a string. You may need to explicitly coerce it to a string expression using
PyExpr.toPyString().
applyForPySrc in interface SoyPySrcPrintDirectivevalue - The value to apply the directive on. This value may not yet have been
coerced to a string.args - The directive's arguments, if any (usually none).