org.apache.commons.jelly.tags.velocity
Class MergeTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.velocity.VelocityTagSupport
          extended byorg.apache.commons.jelly.tags.velocity.MergeTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag

public class MergeTag
extends VelocityTagSupport

A tag that uses Velocity to render a specified template with the JellyContext storing the results in either a variable in the JellyContext or in a specified file.

Version:
$Id: MergeTag.java 155420 2005-02-26 13:06:03Z dirkv $
Author:
Pete Kazmier

Field Summary
 
Fields inherited from class org.apache.commons.jelly.tags.velocity.VelocityTagSupport
VELOCITY_ENGINE_VAR_NAME
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
MergeTag()
           
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput output)
           
 void setBasedir(java.lang.String basedir)
          Sets the base directory used for loading of templates by the Velocity file resource loader.
 void setInputEncoding(java.lang.String encoding)
          Sets the input encoding used in the specified template which defaults to ISO-8859-1.
 void setName(java.lang.String name)
          Sets the file name for the merged output.
 void setOutputEncoding(java.lang.String encoding)
          Sets the output encoding mode which defaults to ISO-8859-1 used when storing the results of a merge in a file.
 void setReadOnly(boolean readOnly)
          Sets the read-only flag for this adapter which prevents modifications in the Velocity context from propogating to the JellyContext.
 void setTemplate(java.lang.String template)
          Sets the filename of the template used to merge with the JellyContext.
 void setVar(java.lang.String var)
          Sets the var used to store the results of the merge.
 
Methods inherited from class org.apache.commons.jelly.tags.velocity.VelocityTagSupport
getVelocityEngine
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeTag

public MergeTag()
Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.JellyTagException
Throws:
org.apache.commons.jelly.JellyTagException

setVar

public void setVar(java.lang.String var)
Sets the var used to store the results of the merge.

Parameters:
var - The var to set in the JellyContext with the results of the merge.

setName

public void setName(java.lang.String name)
Sets the file name for the merged output.

Parameters:
name - The name of the output file that is used to store the results of the merge.

setBasedir

public void setBasedir(java.lang.String basedir)
Sets the base directory used for loading of templates by the Velocity file resource loader.

Parameters:
basedir - The directory where templates can be located by the Velocity file resource loader.

setTemplate

public void setTemplate(java.lang.String template)
Sets the filename of the template used to merge with the JellyContext.

Parameters:
template - The filename of the template to be merged.

setReadOnly

public void setReadOnly(boolean readOnly)
Sets the read-only flag for this adapter which prevents modifications in the Velocity context from propogating to the JellyContext.

Parameters:
readOnly - true prevents modifications from propogating (the default), or false which permits modifications.

setOutputEncoding

public void setOutputEncoding(java.lang.String encoding)
Sets the output encoding mode which defaults to ISO-8859-1 used when storing the results of a merge in a file.

Parameters:
encoding - The file encoding to use when writing the output.

setInputEncoding

public void setInputEncoding(java.lang.String encoding)
Sets the input encoding used in the specified template which defaults to ISO-8859-1.

Parameters:
encoding - The encoding used in the template.


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.