|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.runtime.directive.Directive
public abstract class Directive
Base class for all directives used in Velocity.
Field Summary | |
---|---|
protected RuntimeServices |
rsvc
|
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants |
---|
BLOCK, LINE |
Constructor Summary | |
---|---|
Directive()
|
Method Summary | |
---|---|
int |
getColumn()
for log msg purposes |
int |
getLine()
for log msg purposes |
abstract String |
getName()
Return the name of this directive. |
String |
getScopeName()
|
String |
getTemplateName()
|
abstract int |
getType()
Get the directive type BLOCK/LINE. |
void |
init(RuntimeServices rs,
InternalContextAdapter context,
Node node)
How this directive is to be initialized. |
boolean |
isScopeProvided()
|
protected Scope |
makeScope(Object prev)
|
protected void |
postRender(InternalContextAdapter context)
This cleans up any scope control for this directive after rendering, assuming the scope control was turned on. |
protected void |
preRender(InternalContextAdapter context)
This creates and places the scope control for this directive into the context (if scope provision is turned on). |
abstract boolean |
render(InternalContextAdapter context,
Writer writer,
Node node)
How this directive is to be rendered |
void |
setLocation(int line,
int column)
Allows the template location to be set. |
void |
setLocation(int line,
int column,
String templateName)
Allows the template location to be set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RuntimeServices rsvc
Constructor Detail |
---|
public Directive()
Method Detail |
---|
public abstract String getName()
public abstract int getType()
public void setLocation(int line, int column)
line
- column
- public void setLocation(int line, int column, String templateName)
line
- column
- public int getLine()
public int getColumn()
public String getTemplateName()
public String getScopeName()
public boolean isScopeProvided()
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException
rs
- context
- node
-
TemplateInitException
public abstract boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException
context
- writer
- node
-
IOException
ResourceNotFoundException
ParseErrorException
MethodInvocationException
protected void preRender(InternalContextAdapter context)
protected Scope makeScope(Object prev)
protected void postRender(InternalContextAdapter context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |