org.apache.tools.ant.taskdefs
Class Java

java.lang.Object
  |
  +--org.apache.tools.ant.Task
        |
        +--org.apache.tools.ant.taskdefs.Exec
              |
              +--org.apache.tools.ant.taskdefs.Java

public class Java
extends Exec

This task acts as a loader for java applications but allows to use the same JVM for the called application thus resulting in much faster operation.

Author:
Stefano Mazzocchi stefano@apache.org

Fields inherited from class org.apache.tools.ant.taskdefs.Exec
fos
 
Fields inherited from class org.apache.tools.ant.Task
description, location, project, target, taskName, taskType
 
Constructor Summary
Java()
           
 
Method Summary
protected  java.lang.String[] array(java.util.Vector v)
          Transforms a vector of strings into an array.
 Path createClasspath()
          Creates a nested classpath element
 void execute()
          Do the execution.
 int executeJava()
          Do the execution and return a return code.
protected  void run(java.lang.String classname, java.util.Vector args)
          Executes the given classname with the given arguments as it was a command line application.
 void setArgs(java.lang.String s)
          Set the destination file.
 void setClass(java.lang.String s)
          Set the source file (deprecated).
 void setClassname(java.lang.String s)
          Set the source file.
 void setClasspath(Path s)
          Set the classpath to be used for this compilation.
 void setFork(java.lang.String s)
          Set the forking flag.
 void setJvmargs(java.lang.String s)
          Set the jvm arguments.
protected  java.util.Vector tokenize(java.lang.String args)
          Transforms an argument string into a vector of strings.
 
Methods inherited from class org.apache.tools.ant.taskdefs.Exec
logFlush, outputLog, run, setCommand, setDir, setFailonerror, setOs, setOutput
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getProject, getTaskName, init, log, log, setDescription, setLocation, setOwningTarget, setTaskName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Java

public Java()
Method Detail

execute

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

executeJava

public int executeJava()
                throws BuildException
Do the execution and return a return code.
Returns:
the return code from the execute java cklass if it was executed in a separate VM (fork = "yes").

setClasspath

public void setClasspath(Path s)
Set the classpath to be used for this compilation.

createClasspath

public Path createClasspath()
Creates a nested classpath element

setClass

public void setClass(java.lang.String s)
Set the source file (deprecated).

setClassname

public void setClassname(java.lang.String s)
Set the source file.

setArgs

public void setArgs(java.lang.String s)
Set the destination file.

setFork

public void setFork(java.lang.String s)
Set the forking flag.

setJvmargs

public void setJvmargs(java.lang.String s)
Set the jvm arguments.

run

protected void run(java.lang.String classname,
                   java.util.Vector args)
            throws BuildException
Executes the given classname with the given arguments as it was a command line application.

tokenize

protected java.util.Vector tokenize(java.lang.String args)
Transforms an argument string into a vector of strings.

array

protected java.lang.String[] array(java.util.Vector v)
Transforms a vector of strings into an array.


Copyright © 2000 Apache Software Foundation. All Rights Reserved.