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() |
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
Create a Map of properties that the user has passed in. For example:
#xxx("name=hello" "value=world" "template=foo")
would yield a params that contains {["name", "hello"], ["value", "world"], ["template", "foo"]}
contextAdapter - the context adapternode - 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 setcontextAdapter - the context adapternode - the parameter to set expressed in "name=value" formatorg.apache.velocity.exception.ParseErrorException - in case of parsing errorsorg.apache.velocity.exception.MethodInvocationException - in case of method invocation errorsCopyright © 2000–2025 Apache Software Foundation. All rights reserved.