org.apache.tools.ant.taskdefs.optional.metamata

Class MParse

public class MParse extends AbstractMetamataTask

Simple Metamata MParse task. Based on the original written by Thomas Haas. This version was written for Metamata 2.0 available at http://www.metamata.com

UNKNOWN: make a subclass of AbstractMetaMataTask

Constructor Summary
MParse()
Method Summary
protected voidcheckOptions()
validate options set and resolve files and paths
protected voidcleanUp()
clean up all the mess that we did with temporary objects
protected ExecuteStreamHandlercreateStreamHandler()
return the default stream handler for this task
voidexecute()
execute the command line
protected voidgenerateOptionsFile(File tofile, String[] options)
write all options to a file with one option / line
protected File[]getMetamataLibs()
return an array of files containing the path to the needed libraries to run metamata.
protected VectorgetOptions()
return all options of the command line as string elements
voidsetCleanup(boolean value)
Remove the intermediate Sun JavaCC file ; optional, default false.
voidsetDebugparser(boolean flag)
set parser debug mode; optional, default false
voidsetDebugscanner(boolean flag)
set scanner debug mode; optional, default false
voidsetTarget(File target)
The .jj file to process; required.
protected voidsetUp()
check the options and build the command line
voidsetVerbose(boolean flag)
set verbose mode
protected void_execute(ExecuteStreamHandler handler)
execute the process with a specific handler

Constructor Detail

MParse

public MParse()

Method Detail

checkOptions

protected void checkOptions()
validate options set and resolve files and paths

Throws: BuildException thrown if an option has an incorrect state.

cleanUp

protected void cleanUp()
clean up all the mess that we did with temporary objects

createStreamHandler

protected ExecuteStreamHandler createStreamHandler()
return the default stream handler for this task

execute

public void execute()
execute the command line

generateOptionsFile

protected void generateOptionsFile(File tofile, String[] options)
write all options to a file with one option / line

Parameters: tofile the file to write the options to. options the array of options element to write to the file.

Throws: BuildException thrown if there is a problem while writing to the file.

getMetamataLibs

protected File[] getMetamataLibs()
return an array of files containing the path to the needed libraries to run metamata. The file are not checked for existence. You should do this yourself if needed or simply let the forked process do it for you.

Returns: array of jars/zips needed to run metamata.

getOptions

protected Vector getOptions()
return all options of the command line as string elements

Returns: an array of options corresponding to the setted options.

setCleanup

public void setCleanup(boolean value)
Remove the intermediate Sun JavaCC file ; optional, default false.

setDebugparser

public void setDebugparser(boolean flag)
set parser debug mode; optional, default false

setDebugscanner

public void setDebugscanner(boolean flag)
set scanner debug mode; optional, default false

setTarget

public void setTarget(File target)
The .jj file to process; required.

setUp

protected void setUp()
check the options and build the command line

setVerbose

public void setVerbose(boolean flag)
set verbose mode

_execute

protected void _execute(ExecuteStreamHandler handler)
execute the process with a specific handler
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.