xdoclet.template

Class 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.12 $

Author: Vincent Harcq (vincent.harcq@hubmethods.com)

UNKNOWN: December 27, 2001

Constructor Summary
protected TemplateParser()
Initialize the Template Engine.
Method Summary
voidaddMergeFile(String file)
Callback by the MergeTagsHandler to give the parser the list of merge files involved.
voidgenerate(String template)
In this class, this method does not -generate- anything but only parse the files.
String[]getMergeFiles()
Return the list of merge files involved in the generation.
static TemplateParsergetParserInstance()
Gets the ParserInstance attribute of the TemplateParser class
TemplateTagHandlergetTagHandlerFor(String prefix)
booleanhasMergeFile(String file)
Callback by the MergeTagsHandler to know if a merge file has already been taken into account.
protected Objectinvoke(Method m, Object cmdImplProvider, Object[] params1)
Describe what the method does
protected voidinvokeContentMethod(String cmd, Properties attributes, String template, int i)
Describe what the method does
voidstart()
A utility method used for generating the dest_file based on template_file template file.

Constructor Detail

TemplateParser

protected TemplateParser()
Initialize the Template Engine. Reads the XDoclet properties file, and loads any XTag handler classes specified.

Method Detail

addMergeFile

public void addMergeFile(String file)
Callback by the MergeTagsHandler to give the parser the list of merge files involved.

Parameters: file one merge file involved

generate

public void generate(String template)
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.

Parameters: template Description of Parameter

Throws: TemplateException Description of Exception

getMergeFiles

public String[] getMergeFiles()
Return the list of merge files involved in the generation.

Returns: an array of File

getParserInstance

public static TemplateParser getParserInstance()
Gets the ParserInstance attribute of the TemplateParser class

Returns: The ParserInstance value

getTagHandlerFor

public TemplateTagHandler getTagHandlerFor(String prefix)

hasMergeFile

public boolean hasMergeFile(String file)
Callback by the MergeTagsHandler to know if a merge file has already been taken into account.

Parameters: file

Returns:

invoke

protected Object invoke(Method m, Object cmdImplProvider, Object[] params1)
Describe what the method does

Parameters: m Describe what the parameter does cmdImplProvider Describe what the parameter does params1 Describe what the parameter does

Returns: Describe the return value

Throws: InvocationTargetException Describe the exception IllegalAccessException Describe the exception TemplateException Describe the exception

invokeContentMethod

protected void invokeContentMethod(String cmd, Properties attributes, String template, int i)
Describe what the method does

Parameters: cmd Describe what the parameter does attributes Describe what the parameter does template Describe what the parameter does i Describe what the parameter does

Throws: TemplateException Describe the exception

start

public void start()
A utility method used for generating the dest_file based on template_file template file.

Throws: TemplateException Description of Exception