public abstract class AbstractDirective
extends org.apache.velocity.runtime.directive.Directive
| Constructor and Description |
|---|
AbstractDirective() |
| Modifier and Type | Method and Description |
|---|---|
protected Map |
createPropertyMap(org.apache.velocity.context.InternalContextAdapter contextAdapter,
org.apache.velocity.runtime.parser.node.Node node)
create a Map of properties that the user has passed in.
|
protected abstract Component |
getBean(ValueStack stack,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res) |
abstract String |
getBeanName() |
String |
getName() |
int |
getType()
All components, unless otherwise stated, are LINE-level directives.
|
protected void |
putProperty(Map propertyMap,
org.apache.velocity.context.InternalContextAdapter contextAdapter,
org.apache.velocity.runtime.parser.node.Node node)
adds a given Node's key/value pair to the propertyMap.
|
boolean |
render(org.apache.velocity.context.InternalContextAdapter ctx,
Writer writer,
org.apache.velocity.runtime.parser.node.Node node) |
public String getName()
getName in class org.apache.velocity.runtime.directive.Directivepublic abstract String getBeanName()
public int getType()
getType in class org.apache.velocity.runtime.directive.Directiveprotected abstract Component getBean(ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
public boolean render(org.apache.velocity.context.InternalContextAdapter ctx,
Writer writer,
org.apache.velocity.runtime.parser.node.Node node)
throws IOException,
org.apache.velocity.exception.ResourceNotFoundException,
org.apache.velocity.exception.ParseErrorException,
org.apache.velocity.exception.MethodInvocationException
render in class org.apache.velocity.runtime.directive.DirectiveIOExceptionorg.apache.velocity.exception.ResourceNotFoundExceptionorg.apache.velocity.exception.ParseErrorExceptionorg.apache.velocity.exception.MethodInvocationExceptionprotected Map createPropertyMap(org.apache.velocity.context.InternalContextAdapter contextAdapter, org.apache.velocity.runtime.parser.node.Node node) throws org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException
#xxx("name=hello" "value=world" "template=foo")
would yield a params that contains {["name", "hello"], ["value", "world"], ["template", "foo"]}node - the Node passed in to the render methodorg.apache.velocity.exception.ParseErrorException - if the was an error in the format of the propertyorg.apache.velocity.exception.MethodInvocationExceptionprotected void putProperty(Map propertyMap, org.apache.velocity.context.InternalContextAdapter contextAdapter, org.apache.velocity.runtime.parser.node.Node node) throws org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException
propertyMap - a params containing all the properties that we wish to setnode - the parameter to set expressed in "name=value" formatorg.apache.velocity.exception.ParseErrorExceptionorg.apache.velocity.exception.MethodInvocationExceptionCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.