Uses of Interface
org.apache.velocity.context.Context
-
-
Uses of Context in org.apache.velocity
Classes in org.apache.velocity that implement Context Modifier and Type Class Description class
VelocityContext
General purpose implementation of the application Context interface for general application use.Methods in org.apache.velocity with parameters of type Context Modifier and Type Method Description void
Template. merge(Context context, Writer writer)
The AST node structure is merged with the context to produce the final output.void
Template. merge(Context context, Writer writer, List<String> macroLibraries)
The AST node structure is merged with the context to produce the final output.Constructors in org.apache.velocity with parameters of type Context Constructor Description VelocityContext(Map<String,Object> context, Context innerContext)
Initializes internal storage (never tonull
), and inner context.VelocityContext(Context innerContext)
Chaining constructor, used when you want to wrap a context in another. -
Uses of Context in org.apache.velocity.app
Methods in org.apache.velocity.app with parameters of type Context Modifier and Type Method Description static boolean
Velocity. evaluate(Context context, Writer writer, String logTag, Reader reader)
Renders the input reader using the context into the output writer.static boolean
Velocity. evaluate(Context context, Writer out, String logTag, String instring)
renders the input string using the context into the output writer.boolean
VelocityEngine. evaluate(Context context, Writer writer, String logTag, Reader reader)
Renders the input reader using the context into the output writer.boolean
VelocityEngine. evaluate(Context context, Writer out, String logTag, String instring)
renders the input string using the context into the output writer.static boolean
Velocity. invokeVelocimacro(String vmName, String logTag, String[] params, Context context, Writer writer)
Invokes a currently registered Velocimacro with the params provided and places the rendered stream into the writer.boolean
VelocityEngine. invokeVelocimacro(String vmName, String logTag, String[] params, Context context, Writer writer)
Invokes a currently registered Velocimacro with the params provided and places the rendered stream into the writer.static boolean
Velocity. mergeTemplate(String templateName, String encoding, Context context, Writer writer)
Merges a template and puts the rendered stream into the writerboolean
VelocityEngine. mergeTemplate(String templateName, String encoding, Context context, Writer writer)
merges a template and puts the rendered stream into the writer -
Uses of Context in org.apache.velocity.app.event
Methods in org.apache.velocity.app.event with parameters of type Context Modifier and Type Method Description boolean
EventCartridge. attachToContext(Context context)
Attached the EventCartridge to the context Final because not something one should mess with lightly :)String
EventCartridge. includeEvent(Context context, String includeResourcePath, String currentResourcePath, String directiveName)
Call include event handlersString
IncludeEventHandler. includeEvent(Context context, String includeResourcePath, String currentResourcePath, String directiveName)
Called when an include-type directive is encountered (#include
or#parse
).Object
EventCartridge. invalidGetMethod(Context context, String reference, Object object, String property, Info info)
Call invalid reference handlers for an invalid getterObject
InvalidReferenceEventHandler. invalidGetMethod(Context context, String reference, Object object, String property, Info info)
Called when object is null or there is no getter for the given property.Object
EventCartridge. invalidMethod(Context context, String reference, Object object, String method, Info info)
Call invalid reference handlers for an invalid method callObject
InvalidReferenceEventHandler. invalidMethod(Context context, String reference, Object object, String method, Info info)
Called when object is null or the given method does not exist.boolean
EventCartridge. invalidSetMethod(Context context, String leftreference, String rightreference, Info info)
Call invalid reference handlers for an invalid setterboolean
InvalidReferenceEventHandler. invalidSetMethod(Context context, String leftreference, String rightreference, Info info)
Called when object is null or there is no setter for the given property.Object
EventCartridge. methodException(Context context, Class<?> claz, String method, Exception e, Info info)
Call method exception event handlerObject
MethodExceptionEventHandler. methodException(Context context, Class<?> claz, String method, Exception e, Info info)
Called when a method throws an exception.Object
ReferenceInsertionEventHandler. referenceInsert(Context context, String reference, Object value)
A call-back which is executed during Velocity merge before a reference value is inserted into the output stream. -
Uses of Context in org.apache.velocity.app.event.implement
Methods in org.apache.velocity.app.event.implement with parameters of type Context Modifier and Type Method Description String
IncludeNotFound. includeEvent(Context context, String includeResourcePath, String currentResourcePath, String directiveName)
Check to see if included file exists, and display "not found" page if it doesn't.String
IncludeRelativePath. includeEvent(Context context, String includeResourcePath, String currentResourcePath, String directiveName)
Return path relative to the current template's path.Object
ReportInvalidReferences. invalidGetMethod(Context context, String reference, Object object, String property, Info info)
Collect the error and/or throw an exception, depending on configuration.Object
ReportInvalidReferences. invalidMethod(Context context, String reference, Object object, String method, Info info)
Collect the error and/or throw an exception, depending on configuration.boolean
ReportInvalidReferences. invalidSetMethod(Context context, String leftreference, String rightreference, Info info)
Collect the error and/or throw an exception, depending on configuration.Object
PrintExceptions. methodException(Context context, Class<?> claz, String method, Exception e, Info info)
Render the method exception, and optionally the exception message and stack trace.Object
EscapeReference. referenceInsert(Context context, String reference, Object value)
Escape the provided text if it matches the configured regular expression.void
IncludeNotFound. setContext(Context context)
-
Uses of Context in org.apache.velocity.context
Subinterfaces of Context in org.apache.velocity.context Modifier and Type Interface Description interface
InternalContextAdapter
interface to bring all necessary internal and user contexts together.Classes in org.apache.velocity.context that implement Context Modifier and Type Class Description class
AbstractContext
This class is the abstract base class for all conventional Velocity Context implementations.class
ChainedInternalContextAdapter
This is an abstract internal-use-only context implementation to be used as a subclass for other internal-use-only contexts that wrap other internal-use-only contexts.class
InternalContextAdapterImpl
This adapter class is the container for all context types for internal use.Methods in org.apache.velocity.context that return Context Modifier and Type Method Description Context
AbstractContext. getChainedContext()
returns innerContext if one is chainedContext
ChainedInternalContextAdapter. getInternalUserContext()
Return the inner / user context.Context
InternalContextAdapterImpl. getInternalUserContext()
returns the user data context that we are wrappingContext
InternalWrapperContext. getInternalUserContext()
Returns the wrapped user context.Constructors in org.apache.velocity.context with parameters of type Context Constructor Description AbstractContext(Context inner)
Chaining constructor accepts a Context argument.InternalContextAdapterImpl(Context c)
CTOR takes a Context and wraps it, delegating all 'data' calls to it. -
Uses of Context in org.apache.velocity.example
Classes in org.apache.velocity.example that implement Context Modifier and Type Class Description class
DBContext
Example context impl that uses a database to store stuff :) yes, this is silly expects a mysql db test with table CREATE TABLE contextstore ( k varchar(100), val blob ); very fragile, crappy code....class
TreeMapContext
Example context impl that uses a TreeMap Not much point other than to show how easy it is.Methods in org.apache.velocity.example with parameters of type Context Modifier and Type Method Description Object
EventExample. invalidGetMethod(Context context, String reference, Object object, String property, Info info)
Object
EventExample. invalidMethod(Context context, String reference, Object object, String method, Info info)
boolean
EventExample. invalidSetMethod(Context context, String leftreference, String rightreference, Info info)
Event handler for when the right hand side of a #set() directive is null, which results in a log message.Object
EventExample. methodException(Context context, Class claz, String method, Exception e, Info info)
Object
EventExample. referenceInsert(Context context, String reference, Object value)
Event handler for when a reference is inserted into the output stream.Constructors in org.apache.velocity.example with parameters of type Context Constructor Description DBContext(Context inner)
TreeMapContext(Context inner)
-
Uses of Context in org.apache.velocity.runtime
Methods in org.apache.velocity.runtime with parameters of type Context Modifier and Type Method Description boolean
RuntimeInstance. evaluate(Context context, Writer writer, String logTag, Reader reader)
Renders the input reader using the context into the output writer.boolean
RuntimeInstance. evaluate(Context context, Writer out, String logTag, String instring)
Renders the input string using the context into the output writer.boolean
RuntimeServices. evaluate(Context context, Writer writer, String logTag, Reader reader)
Renders the input reader using the context into the output writer.boolean
RuntimeServices. evaluate(Context context, Writer out, String logTag, String instring)
Renders the input string using the context into the output writer.boolean
RuntimeInstance. invokeVelocimacro(String vmName, String logTag, String[] params, Context context, Writer writer)
Invokes a currently registered Velocimacro with the params provided and places the rendered stream into the writer.boolean
RuntimeServices. invokeVelocimacro(String vmName, String logTag, String[] params, Context context, Writer writer)
Invokes a currently registered Velocimacro with the params provided and places the rendered stream into the writer.boolean
RuntimeInstance. render(Context context, Writer writer, String logTag, SimpleNode nodeTree)
Initializes and renders the ASTSimpleNode
using the context into the output writer. -
Uses of Context in org.apache.velocity.util
Methods in org.apache.velocity.util with parameters of type Context Modifier and Type Method Description void
ContextAware. setContext(Context context)
Initialize the EventHandler.
-