Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant.taskdefs.optional
Class Javah

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

public class Javah
extends Task

Task to generate JNI header files using javah. This task can take the following arguments:

- classname - the fully-qualified name of a class
- outputFile - Concatenates the resulting header or source files for all the classes listed into this file
- destdir - Sets the directory where javah saves the header files or the stub files
- classpath
- bootclasspath
- force - Specifies that output files should always be written (JDK1.2 only)
- old - Specifies that old JDK1.0-style header files should be generated (otherwise output file contain JNI-style native method function prototypes) (JDK1.2 only)
- stubs - generate C declarations from the Java object file (used with old)
- verbose - causes javah to print a message to stdout concerning the status of the generated files
- extdirs - Override location of installed extensions

Of these arguments, either outputFile or destdir is required, but not both. More than one classname may be specified, using a comma-separated list or by using `<class name="xxx">` elements within the task.

When this task executes, it will generate C header and source files that are needed to implement native methods.

Author:
  Rick Beton richard.beton@physics.org

Inner Class Summary
`class` | `Javah.ClassArgument`

Fields inherited from class org.apache.tools.ant.Task
`description, location, project, target, taskName, taskType, wrapper`

Constructor Summary
`Javah()`

Method Summary
`Path` | `createBootclasspath()`
`Javah.ClassArgument` | `createClass()`
`Path` | `createClasspath()`
`void` | `execute()` Executes the task.
`protected void` | `logAndAddFilesToCompile(Commandline cmd)` Logs the compilation parameters, adds the files to compile and logs the &qout;niceSourceList"
`void` | `setBootclasspath(Path src)`
`void` | `setBootClasspathRef(Reference r)` Adds a reference to a CLASSPATH defined elsewhere.
`void` | `setClass(java.lang.String cls)`
`void` | `setClasspath(Path src)`
`void` | `setClasspathRef(Reference r)` Adds a reference to a CLASSPATH defined elsewhere.
`void` | `setDestdir(java.io.File destDir)` Set the destination directory into which the Java source files should be compiled.
`void` | `setForce(boolean force)` Set the force-write flag.
`void` | `setOld(boolean old)` Set the old flag.
`void` | `setOutputFile(java.lang.String outputFile)` Set the output file name.
`void` | `setStubs(boolean stubs)` Set the stubs flag.
`void` | `setVerbose(boolean verbose)` Set the verbose flag.

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

### Javah

    public Javah()

Method Detail

### setClass

    public void setClass(java.lang.String cls)

### createClass

    public Javah.ClassArgument createClass()

### setDestdir

    public void setDestdir(java.io.File destDir)

  Set the destination directory into which the Java source files should be compiled.

### setClasspath

    public void setClasspath(Path src)

### createClasspath

    public Path createClasspath()

### setClasspathRef

    public void setClasspathRef(Reference r)

  Adds a reference to a CLASSPATH defined elsewhere.

### setBootclasspath

    public void setBootclasspath(Path src)

### createBootclasspath

    public Path createBootclasspath()

### setBootClasspathRef

    public void setBootClasspathRef(Reference r)

  Adds a reference to a CLASSPATH defined elsewhere.

### setOutputFile

    public void setOutputFile(java.lang.String outputFile)

  Set the output file name.

### setForce

    public void setForce(boolean force)

  Set the force-write flag.

### setOld

    public void setOld(boolean old)

  Set the old flag.

### setStubs

    public void setStubs(boolean stubs)

  Set the stubs flag.

### setVerbose

    public void setVerbose(boolean verbose)

  Set the verbose flag.

### execute

    public void execute()
                 throws BuildException

  Executes the task.
  Overrides:
    `execute` in class `Task`
  Following copied from class: `org.apache.tools.ant.Task`
  Throws:
    `BuildException` - if someting goes wrong with the build

### logAndAddFilesToCompile

    protected void logAndAddFilesToCompile(Commandline cmd)

  Logs the compilation parameters, adds the files to compile and logs the &qout;niceSourceList"

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache Software Foundation. All Rights Reserved.