org.webmacro.engine
Class BuildContext
java.lang.Object
|
+--org.webmacro.Context
|
+--org.webmacro.engine.BuildContext
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map
- public final class BuildContext
- extends Context
Contains data structures which are manipulated during the
builder phase of parsing. It extends Map so that
user provided directives can store information in it during
the builder phase. Although WebMacro's built in directives
make no use of this hashtable (they use the other structures
added in the derived class), other user provided directives
might. Therefore you should adopt a sensible naming scheme for
your keys, to avoid conflicting with keys inserted by someone else.
Inner classes inherited from class java.util.Map |
java.util.Map.Entry |
Method Summary |
void |
addFilter(Variable var,
Filter ft)
Register a new filter, adding it to the chain for the supplied name. |
void |
clearFilters(Variable var)
Clear all the filtered for the supplied name. |
Macro |
getFilterMacro(Variable v)
Get the filter that applies to a specific variable. |
Parser |
getParser(java.lang.String pname)
|
java.lang.Object |
getVariableType(java.lang.String name)
Find out whether the named variable is a tool, local variable,
or property variable. |
void |
setVariableType(java.lang.String name,
java.lang.Object type)
Declare whether the named variable is to be treated as a tool,
local variable, or property variable type. |
Methods inherited from class org.webmacro.Context |
clear, clone, cloneContext, containsKey, containsValue, entrySet, get, getBroker, getCurrentLocation, getEvaluationExceptionHandler, getLog, getLog, getMap, getPool, getProperty, getProperty, getTemplateEvaluationContext, internalGet, internalGet, isEmpty, isTiming, keySet, loadTools, put, put, put, put, put, put, put, put, put, put, putAll, recycle, remove, set, setEvaluationExceptionHandler, setMap, setPool, setProperty, setProperty, size, startTiming, startTiming, startTiming, startTiming, startTiming, stopTiming, values |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
BuildContext
public BuildContext(Broker b)
getParser
public final Parser getParser(java.lang.String pname)
throws NotFoundException
getVariableType
public java.lang.Object getVariableType(java.lang.String name)
- Find out whether the named variable is a tool, local variable,
or property variable.
setVariableType
public void setVariableType(java.lang.String name,
java.lang.Object type)
- Declare whether the named variable is to be treated as a tool,
local variable, or property variable type.
addFilter
public void addFilter(Variable var,
Filter ft)
- Register a new filter, adding it to the chain for the supplied name.
The name is either a top level property name or * to mean "all".
- Parameters:
name
- the top level property name that is being filteredft
- the Filter which will handle this property
clearFilters
public void clearFilters(Variable var)
- Clear all the filtered for the supplied name. Cleaing * clears
only global filters, leaving filters for specific properties.
getFilterMacro
public Macro getFilterMacro(Variable v)
- Get the filter that applies to a specific variable. Returning
null from this method means that the entire variable should
be dropped from the output since it's been filtered to null.
- Returns:
- the Macro to be used to filter it, or null