com.verhas.velocitoro
Class Engine

java.lang.Object
  extended by com.verhas.velocitoro.Engine

public class Engine
extends Object

The core Velocitoro engine. All the applications, like the Maven plugin, ANT task or the command line version utilize the services provided by this class.

Note that for the different parameters the class has default values that may not be the same as that of the different applications. For example the Maven plugin version sets most of the parameters to values different from the engine default to values that fit more the Maven style.

Author:
Peter Verhas

Constructor Summary
Engine()
           
 
Method Summary
 void createSite()
           
 void setDebug(Boolean debug)
          Set the debug flag.
 void setDebugOutputStream(PrintStream debugOutputStream)
          Set the debug output stream.
 void setGroovyClassPath(String[] groovyClassPath)
          Set the groovy classpath.
 void setIgnoredExtensions(String[] ignoredExtensions)
          Set the array of ignored extensions.
 void setPasses(Integer passes)
          Set the number of passes velocitoro has to perform.
 void setScriptDirectory(String scriptDirectory)
          Set the script directory where the groovy scripts are.
 void setShadowExtension(String shadowExtension)
          Set the extension that the shadow files should have.
 void setSourceDirectoryName(String sourceDirectoryName)
          Set the name of the directory where the source files are.
 void setTagetDirectoryName(String tagetDirectoryName)
          Set the name of the directory where the generated source file will be created.
 void setTemplateEncoding(String templateEncoding)
          Set the character encoding for the templates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Engine

public Engine()
Method Detail

setDebugOutputStream

public void setDebugOutputStream(PrintStream debugOutputStream)
Set the debug output stream. The default value is System.out.

Parameters:
debugOutputStream -

setDebug

public void setDebug(Boolean debug)
Set the debug flag. The default is false. When the default flag is set debug information is sent to the debug output stream.

Parameters:
debug -

setIgnoredExtensions

public void setIgnoredExtensions(String[] ignoredExtensions)
Set the array of ignored extensions. By default this array contains vm, groovy and vmi. Files with those extensions serve special purpose and are not part of the verbatim or processed content.

Parameters:
ignoredExtensions - and array of String containing the ignorable extensions. The strings should NOT contain the dot, e.g. vm and NOT {vode .vm}

setShadowExtension

public void setShadowExtension(String shadowExtension)
Set the extension that the shadow files should have. The default value is vm. A shadow file has the same name as the original file and has the extra extension, vm by default.

Parameters:
shadowExtension - the extension without the dot, e.g. vm and NOT .vm

setPasses

public void setPasses(Integer passes)
Set the number of passes velocitoro has to perform. The default is 1.

Parameters:
passes - the number of passes velocity should run.

setScriptDirectory

public void setScriptDirectory(String scriptDirectory)
Set the script directory where the groovy scripts are.

The default value is null and if it not set then the source directory, where the velicity template files are will be used.

Parameters:
scriptDirectory -

setGroovyClassPath

public void setGroovyClassPath(String[] groovyClassPath)
Set the groovy classpath.

Calling this method you can add directories to the standard Java classpath to include in the search when groovy is locating source files for classes written in groovy.

Parameters:
groovyClassPath - array of directtory names. The default value contains a single directory, named groovy. The maven plugin sets this value to contain a single directory src/main/groovy.

setSourceDirectoryName

public void setSourceDirectoryName(String sourceDirectoryName)
Set the name of the directory where the source files are. The default value is the current working directory. The maven plugin sets this value to src/web by default.

Parameters:
sourceDirectoryName - the name of the source directory

setTagetDirectoryName

public void setTagetDirectoryName(String tagetDirectoryName)
Set the name of the directory where the generated source file will be created. The default value is the directory target under the current working directory. The maven plugin sets this value by default to be target/web.

Parameters:
tagetDirectoryName -

setTemplateEncoding

public void setTemplateEncoding(String templateEncoding)
Set the character encoding for the templates. The default value is UTF-8.

Parameters:
templateEncoding - the standard name of the charset used to encode the source files.

createSite

public void createSite()
                throws Exception
Throws:
Exception


Copyright © 2009 Verhas & Verhas Software Craftsmen Ltd.. All Rights Reserved.