xdoclet.template
Class TemplateParser

java.lang.Object
  |
  +--xdoclet.template.TemplateEngine
        |
        +--xdoclet.template.TemplateParser

public class TemplateParser
extends TemplateEngine

Subclass of Template Engine that do not generate anything but only parse the document. The TagHandlers have a callback entry to this method to set in it anything they want to. This class was introduced for parsing .j files and return a list of merge files needed for the generation. The timestamp checking can then verify all files involved in a generation and bypass the generation if -nothing has changed-.

Version:
$Revision: 1.4 $
Author:
Vincent Harcq (vincent.harcq@hubmethods.com)

Fields inherited from class xdoclet.template.TemplateEngine
out, output, TAG_MAPPINGS_FILE, XDOCLET_HEAD, XDOCLET_HEAD_LEN, XDOCLET_PREFIX, XDOCLET_TAIL, XDOCLET_TAIL_LEN
 
Constructor Summary
TemplateParser(TemplateContext context)
          Initialize the Template Engine.
 
Method Summary
 void addMergeFile(java.io.File file)
          Callback by the MergeTagsHandler to give the parser the list of merge files involved.
 void generate(java.lang.String template)
          In this class, this method does not -generate- anything but only parse the files.
 java.io.File[] getMergeFiles()
          Return the list of merge files involved in the generation.
 void start()
          A utility method used for generating the dest_file based on template_file template file.
 
Methods inherited from class xdoclet.template.TemplateEngine
getCurrentLineNum, getLineNumber, getOutput, getTagHandlerFor, getTemplateURL, handleTag, outputOf, print, setCurrentLineNum, setOutput, setTagHandlerFor, setTemplateURL, setWriter, skipWhitespace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateParser

public TemplateParser(TemplateContext context)
               throws TemplateException
Initialize the Template Engine. Reads the XDoclet properties file, and loads any Tag handler classes specified.
Parameters:
context - The context for the build.
Throws:
TemplateException - Description of Exception
Method Detail

getMergeFiles

public java.io.File[] getMergeFiles()
Return the list of merge files involved in the generation.
Returns:
an array of File

start

public void start()
           throws TemplateException
A utility method used for generating the dest_file based on template_file template file.
Overrides:
start in class TemplateEngine
Throws:
TemplateException - Description of Exception

generate

public void generate(java.lang.String template)
              throws TemplateException
In this class, this method does not -generate- anything but only parse the files. Callback to this class can be made by specific TagHandlers during the process.
Overrides:
generate in class TemplateEngine
Parameters:
template - Description of Parameter
Throws:
TemplateException - Description of Exception

addMergeFile

public void addMergeFile(java.io.File file)
Callback by the MergeTagsHandler to give the parser the list of merge files involved.
Parameters:
file - one merge file involved