Modifier and Type | Class and Description |
---|---|
class |
VelocityContext
General purpose implementation of the application Context
interface for general application use.
|
Modifier and Type | Method and 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 macroLibraries)
The AST node structure is merged with the
context to produce the final output.
|
Constructor and Description |
---|
VelocityContext(Context innerContext)
Chaining constructor, used when you want to
wrap a context in another.
|
VelocityContext(Map<String,Object> context,
Context innerContext)
Initializes internal storage (never to
null ), and
inner context. |
Modifier and Type | Method and Description |
---|---|
boolean |
VelocityEngine.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 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.evaluate(Context context,
Writer out,
String logTag,
String instring)
renders the input string using the context into the output 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.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.mergeTemplate(String templateName,
String encoding,
Context context,
Writer writer)
merges a template and puts 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 writer
|
Modifier and Type | Method and 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 handlers
|
String |
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 getter
|
Object |
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 call
|
Object |
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 setter
|
boolean |
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 handler
|
Object |
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.
|
Modifier and Type | Method and Description |
---|---|
String |
IncludeRelativePath.includeEvent(Context context,
String includeResourcePath,
String currentResourcePath,
String directiveName)
Return path relative to the current template's path.
|
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.
|
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) |
Modifier and Type | Interface and Description |
---|---|
interface |
InternalContextAdapter
interface to bring all necessary internal and user contexts together.
|
Modifier and Type | Class and 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.
|
Modifier and Type | Method and Description |
---|---|
Context |
AbstractContext.getChainedContext()
returns innerContext if one is chained
|
Context |
InternalWrapperContext.getInternalUserContext()
Returns the wrapped user context.
|
Context |
InternalContextAdapterImpl.getInternalUserContext()
returns the user data context that
we are wrapping
|
Context |
ChainedInternalContextAdapter.getInternalUserContext()
Return the inner / user context.
|
Constructor and 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.
|
Modifier and Type | Class and 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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Constructor and Description |
---|
DBContext(Context inner) |
TreeMapContext(Context inner) |
Modifier and Type | Method and Description |
---|---|
boolean |
RuntimeServices.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 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.evaluate(Context context,
Writer out,
String logTag,
String instring)
Renders the input string using the context into the output 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.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 AST
SimpleNode using the context
into the output writer. |
Modifier and Type | Method and Description |
---|---|
void |
ContextAware.setContext(Context context)
Initialize the EventHandler.
|
Copyright © 2000–2017 The Apache Software Foundation. All rights reserved.