org.apache.tools.ant.taskdefs.optional.native2ascii
Class DefaultNative2Ascii

java.lang.Object
  |
  +--org.apache.tools.ant.taskdefs.optional.native2ascii.DefaultNative2Ascii
All Implemented Interfaces:
Native2AsciiAdapter
Direct Known Subclasses:
KaffeNative2Ascii, SunNative2Ascii

public abstract class DefaultNative2Ascii
extends java.lang.Object
implements Native2AsciiAdapter

encapsulates the handling common to diffent Native2Asciiadapter implementations.

Since:
Ant 1.6.3

Constructor Summary
DefaultNative2Ascii()
           
 
Method Summary
protected  void addFiles(Commandline cmd, ProjectComponent log, java.io.File src, java.io.File dest)
          Adds source and dest files to the command line.
 boolean convert(Native2Ascii args, java.io.File srcFile, java.io.File destFile)
          Splits the task into setting up the command line switches (delegated to setup), adding the file names (delegated to addFiles) and running the tool (delegated to run).
protected abstract  boolean run(Commandline cmd, ProjectComponent log)
          Executes the command.
protected  void setup(Commandline cmd, Native2Ascii args)
          Sets up the initial command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNative2Ascii

public DefaultNative2Ascii()
Method Detail

convert

public final boolean convert(Native2Ascii args,
                             java.io.File srcFile,
                             java.io.File destFile)
                      throws BuildException
Splits the task into setting up the command line switches (delegated to setup), adding the file names (delegated to addFiles) and running the tool (delegated to run).

Specified by:
convert in interface Native2AsciiAdapter
Parameters:
args - Task that holds command line arguments and allows the implementation to send messages to Ant's logging system
srcFile - the source to convert
destFile - where to send output to
Returns:
whether the conversion has been successful.
BuildException

setup

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 - Command line to add to
args - provides the user-setting and access to Ant's logging system.
BuildException

addFiles

protected void addFiles(Commandline cmd,
                        ProjectComponent log,
                        java.io.File src,
                        java.io.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 - Command line to add to
log - provides access to Ant's logging system.
src - the source file
dest - the destination file
BuildException

run

protected abstract boolean run(Commandline cmd,
                               ProjectComponent log)
                        throws BuildException
Executes the command.

Parameters:
cmd - Command line to execute
log - provides access to Ant's logging system.
Returns:
whether execution was successful
BuildException


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.