public abstract class AbstractContext extends Object implements Context
Constructor and Description |
---|
AbstractContext()
default CTOR
|
AbstractContext(Context inner)
Chaining constructor accepts a Context argument.
|
Modifier and Type | Method and Description |
---|---|
EventCartridge |
attachEventCartridge(EventCartridge ec) |
boolean |
containsKey(String key)
Indicates whether the specified key is in the context.
|
Object |
get(String key)
Gets the value corresponding to the provided key from the context.
|
Context |
getChainedContext()
returns innerContext if one is chained
|
int |
getCurrentMacroCallDepth()
get the current macro call depth
|
String |
getCurrentMacroName()
get the current macro name
|
Resource |
getCurrentResource()
temporary fix to enable #include() to figure out
current encoding.
|
String |
getCurrentTemplateName()
get the current template name
|
EventCartridge |
getEventCartridge() |
String[] |
getKeys()
Get all the keys for the values in the context
|
List |
getMacroLibraries()
Get the macro library list for the current template.
|
String[] |
getMacroNameStack()
get the current macro name stack
|
String[] |
getTemplateNameStack()
get the current template name stack
|
IntrospectionCacheData |
icacheGet(Object key)
returns an IntrospectionCache Data (@see IntrospectionCacheData)
object if exists for the key
|
void |
icachePut(Object key,
IntrospectionCacheData o)
places an IntrospectionCache Data (@see IntrospectionCacheData)
element in the cache for specified key
|
abstract boolean |
internalContainsKey(String key)
Implement to determine if a key is in the storage.
|
abstract Object |
internalGet(String key)
Implement to return a value from the context storage.
|
abstract String[] |
internalGetKeys()
Implement to return an object array of key
strings from your storage.
|
abstract Object |
internalPut(String key,
Object value)
Implement to put a value into the context storage.
|
abstract Object |
internalRemove(String key)
Implement to remove an item from your storage.
|
void |
popCurrentMacroName()
remove the current macro name from stack
|
void |
popCurrentTemplateName()
remove the current template name from stack
|
void |
pushCurrentMacroName(String s)
set the current macro name on top of stack
|
void |
pushCurrentTemplateName(String s)
set the current template name on top of stack
|
Object |
put(String key,
Object value)
Adds a name/value pair to the context.
|
Object |
remove(String key)
Removes the value associated with the specified key from the context.
|
void |
setCurrentResource(Resource r) |
void |
setMacroLibraries(List macroLibraries)
Set the macro library list for the current template.
|
public AbstractContext()
public AbstractContext(Context inner)
inner
- context to be chainedpublic abstract Object internalGet(String key)
key
- key whose associated value is to be returnedpublic abstract Object internalPut(String key, Object value)
key
- key with which to associate the valuevalue
- value to be associated with the keypublic abstract boolean internalContainsKey(String key)
key
- key to test for existencepublic abstract String[] internalGetKeys()
public abstract Object internalRemove(String key)
key
- key to removepublic Object get(String key)
public boolean containsKey(String key)
containsKey
in interface Context
key
- The key to look for.public String[] getKeys()
public Object remove(String key)
public Context getChainedContext()
null
if notpublic void pushCurrentTemplateName(String s)
s
- current template namepublic void popCurrentTemplateName()
public String getCurrentTemplateName()
public String[] getTemplateNameStack()
public void pushCurrentMacroName(String s)
s
- current macro namepublic void popCurrentMacroName()
public String getCurrentMacroName()
public int getCurrentMacroCallDepth()
public String[] getMacroNameStack()
public IntrospectionCacheData icacheGet(Object key)
key
- key to find in cachepublic void icachePut(Object key, IntrospectionCacheData o)
key
- keyo
- IntrospectionCacheData object to place in cachepublic void setCurrentResource(Resource r)
InternalHousekeepingContext.setCurrentResource(org.apache.velocity.runtime.resource.Resource)
public Resource getCurrentResource()
InternalHousekeepingContext.getCurrentResource()
public void setMacroLibraries(List macroLibraries)
macroLibraries
- list of macro libraries to setInternalHousekeepingContext.setMacroLibraries(List)
public List getMacroLibraries()
InternalHousekeepingContext.getMacroLibraries()
public EventCartridge attachEventCartridge(EventCartridge ec)
attachEventCartridge
in interface InternalEventContext
InternalEventContext.attachEventCartridge(org.apache.velocity.app.event.EventCartridge)
public EventCartridge getEventCartridge()
getEventCartridge
in interface InternalEventContext
InternalEventContext.getEventCartridge()
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.