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

java.lang.Object
  |
  +--org.apache.tools.ant.Task
        |
        +--org.apache.tools.ant.taskdefs.optional.metamata.MParse

public class MParse
extends Task

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

Author:
Stephane Bailliez

Fields inherited from class org.apache.tools.ant.Task
description, location, project, target, taskName, taskType, wrapper
 
Constructor Summary
MParse()
           
 
Method Summary
protected  void _execute(ExecuteStreamHandler handler)
          execute the process with a specific handler
protected  void checkOptions()
          validate options set and resolve files and paths
protected  void cleanUp()
          clean up all the mess that we did with temporary objects
 Path createClasspath()
          create a classpath entry
 Commandline.Argument createJvmarg()
          Creates a nested jvmarg element.
 Path createSourcepath()
          creates a sourcepath entry
protected  ExecuteStreamHandler createStreamHandler()
          return the default stream handler for this task
protected static java.io.File createTmpFile()
          create a temporary file in the current directory
 void execute()
          execute the command line
protected  void generateOptionsFile(java.io.File tofile, java.lang.String[] options)
          write all options to a file with one option / line
protected  java.io.File[] getMetamataLibs()
          return an array of files containing the path to the needed libraries to run metamata.
protected  java.lang.String[] getOptions()
          return all options of the command line as string elements
 void setCleanup(boolean value)
          set the hack to cleanup the temp file
 void setDebugparser(boolean flag)
          set parser debug mode
 void setDebugscanner(boolean flag)
          set scanner debug mode
 void setMaxmemory(java.lang.String max)
          -mx or -Xmx depending on VM version
 void setMetamatahome(java.io.File metamatahome)
          location of metamata dev environment
 void setTarget(java.io.File target)
          the .jj file to process
protected  void setUp()
          check the options and build the command line
 void setVerbose(boolean flag)
          set verbose mode
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MParse

public MParse()
Method Detail

setMetamatahome

public void setMetamatahome(java.io.File metamatahome)
location of metamata dev environment

setTarget

public void setTarget(java.io.File target)
the .jj file to process

createClasspath

public Path createClasspath()
create a classpath entry

createSourcepath

public Path createSourcepath()
creates a sourcepath entry

setVerbose

public void setVerbose(boolean flag)
set verbose mode

setDebugscanner

public void setDebugscanner(boolean flag)
set scanner debug mode

setDebugparser

public void setDebugparser(boolean flag)
set parser debug mode

setCleanup

public void setCleanup(boolean value)
set the hack to cleanup the temp file

createJvmarg

public Commandline.Argument createJvmarg()
Creates a nested jvmarg element.

setMaxmemory

public void setMaxmemory(java.lang.String max)
-mx or -Xmx depending on VM version

execute

public void execute()
             throws BuildException
execute the command line
Overrides:
execute in class Task
Following copied from class: org.apache.tools.ant.Task
Throws:
BuildException - if someting goes wrong with the build

createStreamHandler

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

setUp

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

_execute

protected void _execute(ExecuteStreamHandler handler)
                 throws BuildException
execute the process with a specific handler

cleanUp

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

getMetamataLibs

protected java.io.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.

checkOptions

protected void checkOptions()
                     throws BuildException
validate options set and resolve files and paths
Throws:
BuildException - thrown if an option has an incorrect state.

getOptions

protected java.lang.String[] getOptions()
return all options of the command line as string elements
Parameters:
an - array of options corresponding to the setted options.

generateOptionsFile

protected void generateOptionsFile(java.io.File tofile,
                                   java.lang.String[] options)
                            throws BuildException
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.

createTmpFile

protected static final java.io.File createTmpFile()
create a temporary file in the current directory


Copyright ? 2000 Apache Software Foundation. All Rights Reserved.