xdoclet.plugins
Class VelocityPlugin

java.lang.Object
  |
  +--java.beans.beancontext.BeanContextChildSupport
        |
        +--java.beans.beancontext.BeanContextSupport
              |
              +--xdoclet.beans.BeanContextSupportEx
                    |
                    +--xdoclet.Plugin
                          |
                          +--xdoclet.plugins.ScriptPlugin
                                |
                                +--xdoclet.plugins.VelocityPlugin
All Implemented Interfaces:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, Collection, DesignMode, EventListener, PropertyChangeListener, Serializable, VetoableChangeListener, Visibility
Direct Known Subclasses:
AntDocPlugin, BeanInfoPlugin, ManifestPlugin, XGGPlugin, XTagXml2BeanPlugin

public class VelocityPlugin
extends ScriptPlugin

Plugin backed by Velocity.

Version:
$Revision: 1.12 $
Author:
Aslak Hellesøy
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.beans.beancontext.BeanContextSupport
bcmListeners, children, designTime, locale, okToUseGui
 
Fields inherited from class java.beans.beancontext.BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
 
Fields inherited from interface java.beans.beancontext.BeanContext
globalHierarchyLock
 
Fields inherited from interface java.beans.DesignMode
PROPERTYNAME
 
Constructor Summary
VelocityPlugin()
           
 
Method Summary
protected  void generate(File file, Collection metaData)
          Generates a file.
protected  void generate(File file, Object metaData)
          Generates a file.
 void setTemplatePath(String templateName)
          Sets the template name.
 
Methods inherited from class xdoclet.plugins.ScriptPlugin
createProperty, execute, getContextObjects, getTemplatePath, setContextObject, validate
 
Methods inherited from class xdoclet.Plugin
Acleanup, AcreateMetadataCollection, AgetFilenameSubstitutionValue, AgetPackageName, AsetClasspath, checkClass, createAccept, createPackageSubstitution, getDestinationDir, getDestinationFileForAll, getDestinationFileForOne, getEncoding, getFileName, getFilteredMetadataCollection, getMetadataProvider, getName, getPackageName, getXDoclet, isGenerateOneFile, jxpath, setDestination, setDestinationDir, setEncoding, setFileName, setMetadataProvider, setName, setPackageName
 
Methods inherited from class xdoclet.beans.BeanContextSupportEx
add, createInvocations, getInvocations, getParent, setParent
 
Methods inherited from class java.beans.beancontext.BeanContextSupport
addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, bcsPreDeserializationHook, bcsPreSerializationHook, childDeserializedHook, childJustAddedHook, childJustRemovedHook, classEquals, clear, contains, containsAll, containsKey, copyChildren, createBCSChild, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, initialize, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, propertyChange, readChildren, remove, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, vetoableChange, writeChildren
 
Methods inherited from class java.beans.beancontext.BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

VelocityPlugin

public VelocityPlugin()
Method Detail

setTemplatePath

public void setTemplatePath(String templateName)
Sets the template name. Velocity will search for this template on the classpath XDoclet was launched with. Sets the path to the template. This should be a relative path. The template will be searched for on the classpath, using the relative path inside jar files or directories.

Overrides:
setTemplatePath in class ScriptPlugin
Parameters:
templateName - relative path to the template to use.

generate

protected final void generate(File file,
                              Collection metaData)
                       throws IOException,
                              XDocletException
Description copied from class: Plugin
Generates a file.

Overrides:
generate in class ScriptPlugin
Parameters:
file - file to be generated.
metaData - metadata used during generation.
Throws:
IOException - if an IO error occurs.
XDocletException - if generation fails.

generate

protected final void generate(File file,
                              Object metaData)
                       throws IOException,
                              XDocletException
Description copied from class: Plugin
Generates a file.

Overrides:
generate in class ScriptPlugin
Parameters:
file - file to be generated.
metaData - metadata used during generation.
Throws:
XDocletException - if generation fails.
IOException - if an IO error occurs.


Copyright © 2000-2003 XDoclet Team. All Rights Reserved.