public interface RenderingContext
Modifier and Type | Method and Description |
---|---|
Value |
executeFunction(String name,
Value... args)
Execute a named function.
|
Macro |
findMacro(String name)
Lookup a macro that's already been registered.
|
EscapeMode |
getAutoEscapeMode()
Read the currently set auto escape mode.
|
AutoEscapeOptions |
getAutoEscapeOptions()
Returns the configured AutoEscapeOptions to be used while rendering the current template.
|
DataContext |
getDataContext()
Return the DataContext object associated with this RenderingContext.
|
Iterable<String> |
getIncludedTemplateNames()
Returns the ordered, mutable stack of names of included templates.
|
ResourceLoader |
getResourceLoader()
Returns the ResourceLoader object to use to fetch files needed to render the current template.
|
boolean |
isEscapingFunction(String name)
Look up a function by name, and report whether it is an escaping function.
|
boolean |
isRuntimeAutoEscaping()
Indicates whether runtime auto escaping is in progress.
|
void |
popAutoEscapeMode() |
void |
popEscapingFunction() |
void |
popExecutionContext() |
boolean |
popIncludeStackEntry(String templateName)
Removes an entry with a name of the template from the stack.
|
void |
pushAutoEscapeMode(EscapeMode mode)
Push a new auto escaping mode onto the context.
|
void |
pushEscapingFunction(String escaperName)
Push a new escaping function onto the context.
|
void |
pushExecutionContext(Template template)
Push a new template onto the current execution context.
|
boolean |
pushIncludeStackEntry(String templateName)
Adds an entry with a name of the template to the stack keeping all names of already included
templates.
|
void |
registerMacro(String name,
Macro macro)
Register a macro in the current rendering context.
|
void |
setCurrentPosition(int line,
int column)
Sets the current position in the template.
|
void |
startRuntimeAutoEscaping()
Start an auto escaping context to parse and auto escape template contents as they are being
rendered.
|
void |
stopRuntimeAutoEscaping()
Stop runtime auto escaping.
|
void |
writeEscaped(String text)
Write some text out, using the current escaping function.
|
void |
writeUnescaped(CharSequence text)
Write some text out, without doing any escaping.
|
Value executeFunction(String name, Value... args) throws JSilverInterpreterException
JSilverInterpreterException
boolean isEscapingFunction(String name)
EscapingEvaluator
void writeEscaped(String text)
void writeUnescaped(CharSequence text)
void pushEscapingFunction(String escaperName)
popEscapingFunction()
void popEscapingFunction()
pushEscapingFunction(String)
void pushExecutionContext(Template template)
popExecutionContext()
void popExecutionContext()
pushExecutionContext(Template)
void setCurrentPosition(int line, int column)
void registerMacro(String name, Macro macro)
Macro findMacro(String name) throws JSilverInterpreterException
JSilverInterpreterException
DataContext getDataContext()
ResourceLoader getResourceLoader()
AutoEscapeOptions getAutoEscapeOptions()
void pushAutoEscapeMode(EscapeMode mode)
popAutoEscapeMode()
void popAutoEscapeMode()
EscapeMode getAutoEscapeMode()
boolean isRuntimeAutoEscaping()
isRuntimeAutoEscaping()
void startRuntimeAutoEscaping()
stopRuntimeAutoEscaping()
void stopRuntimeAutoEscaping()
startRuntimeAutoEscaping()
boolean pushIncludeStackEntry(String templateName)
templateName
- name of the template to be added to the stack. If null
a NullPointerException
will be thrown.templateName
was added.boolean popIncludeStackEntry(String templateName)
templateName
- templateName
was on the stack.Copyright © 2010-2013 Google. All Rights Reserved.