Top Description Constructors Methods
org.apache.tools.ant.taskdefs.optional.native2ascii

public abstract Class DefaultNative2Ascii

extends Object
implements Native2AsciiAdapter
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.optional.native2ascii.Native2AsciiAdapter
Known Direct Subclasses
org.apache.tools.ant.taskdefs.optional.native2ascii.KaffeNative2Ascii, org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii
Imports
java.io.File, org.apache.tools.ant.BuildException, .ProjectComponent, org.apache.tools.ant.taskdefs.optional.Native2Ascii, org.apache.tools.ant.types.Commandline

encapsulates the handling common to different Native2AsciiAdapter implementations.
Since
Ant 1.6.3

Constructor Summary

AccessConstructor and Description
public
DefaultNative2Ascii()

No-arg constructor.

Method Summary

Modifier and TypeMethod and Description
protected void
addFiles(Commandline
Command line to add to
cmd
,
ProjectComponent
provides access to Ant's logging system.
log
,
File
the source file
src
,
File
the destination file
dest
)

Adds source and dest files to the command line.

public final boolean

Returns:

run if the conversion was successful.
convert
(Native2Ascii
the native 2 ascii arguments.
args
,
File
the source file.
srcFile
,
File
the destination file.
destFile
)

Implements org.apache.tools.ant.taskdefs.optional.native2ascii.Native2AsciiAdapter.convert.

Splits the task into setting up the command line switches
protected abstract boolean

Returns:

whether execution was successful
run
(Commandline
Command line to execute
cmd
,
ProjectComponent
provides access to Ant's logging system.
log
)

Executes the command.

protected void
setup(Commandline
Command line to add to
cmd
,
Native2Ascii
provides the user-setting and access to Ant's logging system.
args
)

Sets up the initial command line.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DefaultNative2Asciiback to summary
public DefaultNative2Ascii()

No-arg constructor.

Method Detail

addFilesback to summary
protected void addFiles(Commandline cmd, ProjectComponent log, File src, File dest) throws BuildException

Adds source and dest files to the command line.

This implementation adds them without any leading qualifiers, source first.

Parameters
cmd:Commandline

Command line to add to

log:ProjectComponent

provides access to Ant's logging system.

src:File

the source file

dest:File

the destination file

Exceptions
BuildException:
if there was a problem.
convertback to summary
public final boolean convert(Native2Ascii args, File srcFile, File destFile) throws BuildException

Implements org.apache.tools.ant.taskdefs.optional.native2ascii.Native2AsciiAdapter.convert.

Splits the task into setting up the command line switches

Parameters
args:Native2Ascii

the native 2 ascii arguments.

srcFile:File

the source file.

destFile:File

the destination file.

Returns:boolean

run if the conversion was successful.

Annotations
@Override
Exceptions
BuildException:
if there is a problem. (delegated to setup), adding the file names (delegated to addFiles) and running the tool (delegated to run).
runback to summary
protected abstract boolean run(Commandline cmd, ProjectComponent log) throws BuildException

Executes the command.

Parameters
cmd:Commandline

Command line to execute

log:ProjectComponent

provides access to Ant's logging system.

Returns:boolean

whether execution was successful

Exceptions
BuildException:
if there was a problem.
setupback to summary
protected void setup(Commandline cmd, Native2Ascii args) throws BuildException

Sets up the initial command line.

only the -encoding argument and nested arg elements get handled here.

Parameters
cmd:Commandline

Command line to add to

args:Native2Ascii

provides the user-setting and access to Ant's logging system.

Exceptions
BuildException:
if there was a problem.