Top Description Inners Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional

public Class Javah

extends Task
Class Inheritance
Imports
java.io.File, java.util.EnumSet, .List, .Set, .Vector, java.util.stream.Stream, org.apache.tools.ant.BuildException, .Project, .Task, org.apache.tools.ant.taskdefs.optional.javah.JavahAdapter, .JavahAdapterFactory, org.apache.tools.ant.types.Commandline, .FileSet, .Path, .Reference, org.apache.tools.ant.util.facade.FacadeTaskHelper, .ImplementationSpecificArgument

Generates JNI header files using javah. This task can take the following arguments: 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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
Javah.ClassArgument

A class corresponding the the nested "class" element.

private static enum

Field Summary

Modifier and TypeField and Description
private Path
private List<Javah.ClassArgument>
private Path
private String
private File
private FacadeTaskHelper
private Vector<FileSet>
private boolean
private JavahAdapter
private boolean
private File
private boolean
private boolean
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public
Javah()

No arg constructor.

Method Summary

Modifier and TypeMethod and Description
public void
add(JavahAdapter
JavahAdapter
adapter
)

Set the adapter explicitly.

public void
addFileSet(FileSet
the fileset to add.
fs
)

Add a fileset.

public ImplementationSpecificArgument

Returns:

a ImplementationSpecificArgument to be configured.
createArg
()

Adds an implementation specific command-line argument.

public Path

Returns:

a path to be configured.
createBootclasspath
()

Adds path to bootstrap class files.

public Javah.ClassArgument

Returns:

a ClassArgument to be configured.
createClass
()

Adds class to process.

public Path

Returns:

a path to be configured.
createClasspath
()

Path to use for classpath.

public Path

Returns:

Path
createImplementationClasspath
()

The classpath to use when loading the javah implementation if it is not a built-in one.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Execute the task
public Path

Returns:

the bootclass path.
getBootclasspath
()

The bootclasspath to use.

public String[]

Returns:

the array of classes.
getClasses
()

Names of the classes to process.

public Path

Returns:

the classpath.
getClasspath
()

The classpath to use.

public String[]

Returns:

the arguments.
getCurrentArgs
()

Returns the (implementation specific) settings given as nested arg elements.

public File

Returns:

the destination directory.
getDestdir
()

The destination directory, if any.

public boolean

Returns:

the force attribute.
getForce
()

Whether output files should always be written.

public boolean

Returns:

the old attribute.
getOld
()

Whether old JDK1.0-style header files should be generated.

public File

Returns:

the destination file.
getOutputfile
()

The destination file, if any.

public boolean

Returns:

the stubs attribute.
getStubs
()

Whether C declarations from the Java object file should be generated.

public boolean

Returns:

the verbose attribute.
getVerbose
()

Whether verbose output should get generated.

public void
logAndAddFiles(Commandline
the command line.
cmd
)

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

protected void
logAndAddFilesToCompile(Commandline
the command line to add parameters to.
cmd
)

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

public void
setBootclasspath(Path
the bootstrap classpath.
src
)

location of bootstrap class files.

public void
setBootClasspathRef(Reference
a reference to a classpath
r
)

To the bootstrap path, this adds a reference to a classpath defined elsewhere.

public void
setClass(String
the classname (or classnames).
cls
)

the fully-qualified name of the class (or classes, separated by commas).

public void
setClasspath(Path
the classpath.
src
)

the classpath to use.

public void
setClasspathRef(Reference
a reference to a classpath.
r
)

Adds a reference to a classpath defined elsewhere.

public void
setDestdir(File
the destination directory.
destDir
)

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

public void
setForce(boolean
the value to use.
force
)

If true, output files should always be written (JDK1.2 only).

public void
setImplementation(String
the name of the implementation.
impl
)

Choose the implementation for this particular task.

public void
setOld(boolean
if true use old 1.0 style header files.
old
)

If true, specifies that old JDK1.0-style header files should be generated.

public void
setOutputFile(File
the output file.
outputFile
)

Concatenates the resulting header or source files for all the classes listed into this file.

public void
setStubs(boolean
if true, generated C declarations.
stubs
)

If true, generate C declarations from the Java object file (used with old).

public void
setVerbose(boolean
if true, do verbose printing.
verbose
)

If true, causes Javah to print a message concerning the status of the generated files.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

bootclasspathback to summary
private Path bootclasspath
classesback to summary
private List<Javah.ClassArgument> classes
classpathback to summary
private Path classpath
clsback to summary
private String cls
destDirback to summary
private File destDir
facadeback to summary
private FacadeTaskHelper facade
filesback to summary
private Vector<FileSet> files
forceback to summary
private boolean force
nestedAdapterback to summary
private JavahAdapter nestedAdapter
oldback to summary
private boolean old
outputFileback to summary
private File outputFile
stubsback to summary
private boolean stubs
verboseback to summary
private boolean verbose

Constructor Detail

Javahback to summary
public Javah()

No arg constructor.

Method Detail

addback to summary
public void add(JavahAdapter adapter)

Set the adapter explicitly.

Parameters
adapter:JavahAdapter

JavahAdapter

Since
Ant 1.8.0
addFileSetback to summary
public void addFileSet(FileSet fs)

Add a fileset.

Parameters
fs:FileSet

the fileset to add.

createArgback to summary
public ImplementationSpecificArgument createArg()

Adds an implementation specific command-line argument.

Returns:ImplementationSpecificArgument

a ImplementationSpecificArgument to be configured.

Since
Ant 1.6.3
createBootclasspathback to summary
public Path createBootclasspath()

Adds path to bootstrap class files.

Returns:Path

a path to be configured.

createClassback to summary
public Javah.ClassArgument createClass()

Adds class to process.

Returns:Javah.ClassArgument

a ClassArgument to be configured.

createClasspathback to summary
public Path createClasspath()

Path to use for classpath.

Returns:Path

a path to be configured.

createImplementationClasspathback to summary
public Path createImplementationClasspath()

The classpath to use when loading the javah implementation if it is not a built-in one.

Returns:Path

Path

Since
Ant 1.8.0
executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Execute the task

Annotations
@Override
Exceptions
BuildException:
is there is a problem in the task execution.
getBootclasspathback to summary
public Path getBootclasspath()

The bootclasspath to use.

Returns:Path

the bootclass path.

Since
Ant 1.6.3
getClassesback to summary
public String[] getClasses()

Names of the classes to process.

Returns:String[]

the array of classes.

Since
Ant 1.6.3
getClasspathback to summary
public Path getClasspath()

The classpath to use.

Returns:Path

the classpath.

Since
Ant 1.6.3
getCurrentArgsback to summary
public String[] getCurrentArgs()

Returns the (implementation specific) settings given as nested arg elements.

Returns:String[]

the arguments.

Since
Ant 1.6.3
getDestdirback to summary
public File getDestdir()

The destination directory, if any.

Returns:File

the destination directory.

Since
Ant 1.6.3
getForceback to summary
public boolean getForce()

Whether output files should always be written.

Returns:boolean

the force attribute.

Since
Ant 1.6.3
getOldback to summary
public boolean getOld()

Whether old JDK1.0-style header files should be generated.

Returns:boolean

the old attribute.

Since
Ant 1.6.3
getOutputfileback to summary
public File getOutputfile()

The destination file, if any.

Returns:File

the destination file.

Since
Ant 1.6.3
getStubsback to summary
public boolean getStubs()

Whether C declarations from the Java object file should be generated.

Returns:boolean

the stubs attribute.

Since
Ant 1.6.3
getVerboseback to summary
public boolean getVerbose()

Whether verbose output should get generated.

Returns:boolean

the verbose attribute.

Since
Ant 1.6.3
logAndAddFilesback to summary
public void logAndAddFiles(Commandline cmd)

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

Parameters
cmd:Commandline

the command line.

logAndAddFilesToCompileback to summary
protected void logAndAddFilesToCompile(Commandline cmd)

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

Parameters
cmd:Commandline

the command line to add parameters to.

setBootclasspathback to summary
public void setBootclasspath(Path src)

location of bootstrap class files.

Parameters
src:Path

the bootstrap classpath.

setBootClasspathRefback to summary
public void setBootClasspathRef(Reference r)

To the bootstrap path, this adds a reference to a classpath defined elsewhere.

Parameters
r:Reference

a reference to a classpath

setClassback to summary
public void setClass(String cls)

the fully-qualified name of the class (or classes, separated by commas).

Parameters
cls:String

the classname (or classnames).

setClasspathback to summary
public void setClasspath(Path src)

the classpath to use.

Parameters
src:Path

the classpath.

setClasspathRefback to summary
public void setClasspathRef(Reference r)

Adds a reference to a classpath defined elsewhere.

Parameters
r:Reference

a reference to a classpath.

setDestdirback to summary
public void setDestdir(File destDir)

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

Parameters
destDir:File

the destination directory.

setForceback to summary
public void setForce(boolean force)

If true, output files should always be written (JDK1.2 only).

Parameters
force:boolean

the value to use.

setImplementationback to summary
public void setImplementation(String impl)

Choose the implementation for this particular task.

Parameters
impl:String

the name of the implementation.

Since
Ant 1.6.3
setOldback to summary
public void setOld(boolean old)

If true, specifies that old JDK1.0-style header files should be generated. (otherwise output file contain JNI-style native method function prototypes) (JDK1.2 only).

Parameters
old:boolean

if true use old 1.0 style header files.

setOutputFileback to summary
public void setOutputFile(File outputFile)

Concatenates the resulting header or source files for all the classes listed into this file.

Parameters
outputFile:File

the output file.

setStubsback to summary
public void setStubs(boolean stubs)

If true, generate C declarations from the Java object file (used with old).

Parameters
stubs:boolean

if true, generated C declarations.

setVerboseback to summary
public void setVerbose(boolean verbose)

If true, causes Javah to print a message concerning the status of the generated files.

Parameters
verbose:boolean

if true, do verbose printing.

org.apache.tools.ant.taskdefs.optional back to summary

public Class Javah.ClassArgument

extends Object
Class Inheritance

A class corresponding the the nested "class" element. It contains a "name" attribute.

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name attribute.
getName
()

Get the name attribute.

public void
setName(String
the name attribute.
name
)

Set the name attribute.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
private String name

Constructor Detail

ClassArgumentback to summary
public ClassArgument()

Method Detail

getNameback to summary
public String getName()

Get the name attribute.

Returns:String

the name attribute.

setNameback to summary
public void setName(String name)

Set the name attribute.

Parameters
name:String

the name attribute.

org.apache.tools.ant.taskdefs.optional back to summary

private final Enum Javah.Settings

extends Enum<Javah.Settings>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Javah.Settings
public static final Javah.Settings
public static final Javah.Settings

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Javah.Settings
public static Javah.Settings[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

classesback to summary
public static final Javah.Settings classes
clsback to summary
public static final Javah.Settings cls
filesback to summary
public static final Javah.Settings files

Constructor Detail

Settingsback to summary
private Settings()

Method Detail

valueOfback to summary
public static Javah.Settings valueOf(String name)
valuesback to summary
public static Javah.Settings[] values()