Class ParamDirective
- java.lang.Object
-
- org.apache.velocity.runtime.directive.Directive
-
- com.atlassian.confluence.setup.velocity.ParamDirective
-
- All Implemented Interfaces:
Cloneable
,org.apache.velocity.runtime.directive.DirectiveConstants
public final class ParamDirective extends org.apache.velocity.runtime.directive.Directive
A ParamDirective for Velocity to add parameters to a decorator directive. All the parameters provided to the decorator are available in a Map called $paramsExample use:
#applyDecorator( ... )
#decoratorParam("paramname" $foo)
#decoratorParam("otherparam" "bar")
#end- See Also:
ApplyDecoratorDirective
-
-
Constructor Summary
Constructors Constructor Description ParamDirective()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Returns the name of the directive.int
getType()
Tells velocity that this is a block-type directive.void
init(org.apache.velocity.runtime.RuntimeServices services, org.apache.velocity.context.InternalContextAdapter adapter, org.apache.velocity.runtime.parser.node.Node node)
The directive is initialized.boolean
render(org.apache.velocity.context.InternalContextAdapter adapter, Writer writer, org.apache.velocity.runtime.parser.node.Node node)
Add the actual parameter
-
-
-
Method Detail
-
getName
public String getName()
Returns the name of the directive.- Specified by:
getName
in classorg.apache.velocity.runtime.directive.Directive
- Returns:
- name of the directive
-
getType
public int getType()
Tells velocity that this is a block-type directive.- Specified by:
getType
in classorg.apache.velocity.runtime.directive.Directive
- Returns:
- directive type
-
init
public void init(org.apache.velocity.runtime.RuntimeServices services, org.apache.velocity.context.InternalContextAdapter adapter, org.apache.velocity.runtime.parser.node.Node node)
The directive is initialized.- Overrides:
init
in classorg.apache.velocity.runtime.directive.Directive
- Parameters:
services
- Velocity runtime services.adapter
- context.node
- within the directive.
-
render
public boolean render(org.apache.velocity.context.InternalContextAdapter adapter, 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
Add the actual parameter- Specified by:
render
in classorg.apache.velocity.runtime.directive.Directive
- Parameters:
adapter
- the context.writer
- a writer instance to which to write the decorated text.node
- the node within our block.- Throws:
IOException
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException
-
-