|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.template.soy.data.SanitizedContents
@ParametersAreNonnullByDefault public final class SanitizedContents
Creation utilities for SanitizedContent objects for common use cases.
This should contain utilities that have extremely broad application. More specific utilities should reside with the specific project.
All utilities here should be extremely difficult to abuse in a way that could create attacker-controlled SanitizedContent objects. Java's type system is a great tool to achieve this.
| Method Summary | |
|---|---|
static SanitizedContent |
emptyString(SanitizedContent.ContentKind kind)
Creates an empty string constant. |
static SanitizedContent |
fromResource(Class<?> contextClass,
String resourceName,
Charset charset,
SanitizedContent.ContentKind kind)
Loads assumed-safe content from a Java resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SanitizedContent emptyString(SanitizedContent.ContentKind kind)
throws IOException
IOException
public static SanitizedContent fromResource(Class<?> contextClass,
String resourceName,
Charset charset,
SanitizedContent.ContentKind kind)
throws IOException
contextClass - Class relative to which to load the resource.resourceName - The name of the resource, relative to the context class.charset - The character set to use, usually Charsets.UTF_8.kind - The content kind of the resource.
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||