git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@476574 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -31,11 +31,17 @@ import org.apache.tools.ant.types.Commandline; | |||||
| */ | */ | ||||
| public abstract class DefaultNative2Ascii implements Native2AsciiAdapter { | public abstract class DefaultNative2Ascii implements Native2AsciiAdapter { | ||||
| /** No-arg constructor. */ | |||||
| public DefaultNative2Ascii() { | public DefaultNative2Ascii() { | ||||
| } | } | ||||
| /** | /** | ||||
| * Splits the task into setting up the command line switches | * Splits the task into setting up the command line switches | ||||
| * @param args the native 2 ascii arguments. | |||||
| * @param srcFile the source file. | |||||
| * @param destFile the destination file. | |||||
| * @return run if the conversion was successful. | |||||
| * @throws BuildException if there is a problem. | |||||
| * (delegated to {@link #setup setup}), adding the file names | * (delegated to {@link #setup setup}), adding the file names | ||||
| * (delegated to {@link #addFiles addFiles}) and running the tool | * (delegated to {@link #addFiles addFiles}) and running the tool | ||||
| * (delegated to {@link #run run}). | * (delegated to {@link #run run}). | ||||
| @@ -57,6 +63,7 @@ public abstract class DefaultNative2Ascii implements Native2AsciiAdapter { | |||||
| * @param cmd Command line to add to | * @param cmd Command line to add to | ||||
| * @param args provides the user-setting and access to Ant's | * @param args provides the user-setting and access to Ant's | ||||
| * logging system. | * logging system. | ||||
| * @throws BuildException if there was a problem. | |||||
| */ | */ | ||||
| protected void setup(Commandline cmd, Native2Ascii args) | protected void setup(Commandline cmd, Native2Ascii args) | ||||
| throws BuildException { | throws BuildException { | ||||
| @@ -77,6 +84,7 @@ public abstract class DefaultNative2Ascii implements Native2AsciiAdapter { | |||||
| * @param log provides access to Ant's logging system. | * @param log provides access to Ant's logging system. | ||||
| * @param src the source file | * @param src the source file | ||||
| * @param dest the destination file | * @param dest the destination file | ||||
| * @throws BuildException if there was a problem. | |||||
| */ | */ | ||||
| protected void addFiles(Commandline cmd, ProjectComponent log, File src, | protected void addFiles(Commandline cmd, ProjectComponent log, File src, | ||||
| File dest) throws BuildException { | File dest) throws BuildException { | ||||
| @@ -90,6 +98,7 @@ public abstract class DefaultNative2Ascii implements Native2AsciiAdapter { | |||||
| * @param cmd Command line to execute | * @param cmd Command line to execute | ||||
| * @param log provides access to Ant's logging system. | * @param log provides access to Ant's logging system. | ||||
| * @return whether execution was successful | * @return whether execution was successful | ||||
| * @throws BuildException if there was a problem. | |||||
| */ | */ | ||||
| protected abstract boolean run(Commandline cmd, ProjectComponent log) | protected abstract boolean run(Commandline cmd, ProjectComponent log) | ||||
| throws BuildException; | throws BuildException; | ||||
| @@ -42,6 +42,7 @@ public final class KaffeNative2Ascii extends DefaultNative2Ascii { | |||||
| */ | */ | ||||
| public static final String IMPLEMENTATION_NAME = "kaffe"; | public static final String IMPLEMENTATION_NAME = "kaffe"; | ||||
| /** {@inheritDoc} */ | |||||
| protected void setup(Commandline cmd, Native2Ascii args) | protected void setup(Commandline cmd, Native2Ascii args) | ||||
| throws BuildException { | throws BuildException { | ||||
| if (args.getReverse()) { | if (args.getReverse()) { | ||||
| @@ -50,6 +51,7 @@ public final class KaffeNative2Ascii extends DefaultNative2Ascii { | |||||
| super.setup(cmd, args); | super.setup(cmd, args); | ||||
| } | } | ||||
| /** {@inheritDoc} */ | |||||
| protected boolean run(Commandline cmd, ProjectComponent log) | protected boolean run(Commandline cmd, ProjectComponent log) | ||||
| throws BuildException { | throws BuildException { | ||||
| ExecuteJava ej = new ExecuteJava(); | ExecuteJava ej = new ExecuteJava(); | ||||
| @@ -77,9 +79,10 @@ public final class KaffeNative2Ascii extends DefaultNative2Ascii { | |||||
| try { | try { | ||||
| return Class.forName(N2A_CLASSNAMES[i]); | return Class.forName(N2A_CLASSNAMES[i]); | ||||
| } catch (ClassNotFoundException cnfe) { | } catch (ClassNotFoundException cnfe) { | ||||
| // Ignore | |||||
| } | } | ||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| } | |||||
| } | |||||
| @@ -35,7 +35,8 @@ public interface Native2AsciiAdapter { | |||||
| * @param srcFile the source to convert | * @param srcFile the source to convert | ||||
| * @param destFile where to send output to | * @param destFile where to send output to | ||||
| * @return whether the conversion has been successful. | * @return whether the conversion has been successful. | ||||
| * @throws BuildException if there was a problem. | |||||
| */ | */ | ||||
| boolean convert(Native2Ascii args, File srcFile, File destFile) | boolean convert(Native2Ascii args, File srcFile, File destFile) | ||||
| throws BuildException; | throws BuildException; | ||||
| } | |||||
| } | |||||
| @@ -52,6 +52,7 @@ public class Native2AsciiAdapterFactory { | |||||
| * @param log a ProjectComponent instance used to access Ant's | * @param log a ProjectComponent instance used to access Ant's | ||||
| * logging system. | * logging system. | ||||
| * @return The adapter to use. | * @return The adapter to use. | ||||
| * @throws BuildException if there was a problem. | |||||
| */ | */ | ||||
| public static Native2AsciiAdapter getAdapter(String choice, | public static Native2AsciiAdapter getAdapter(String choice, | ||||
| ProjectComponent log) | ProjectComponent log) | ||||
| @@ -35,6 +35,7 @@ public final class SunNative2Ascii extends DefaultNative2Ascii { | |||||
| */ | */ | ||||
| public static final String IMPLEMENTATION_NAME = "sun"; | public static final String IMPLEMENTATION_NAME = "sun"; | ||||
| /** {@inheritDoc} */ | |||||
| protected void setup(Commandline cmd, Native2Ascii args) | protected void setup(Commandline cmd, Native2Ascii args) | ||||
| throws BuildException { | throws BuildException { | ||||
| if (args.getReverse()) { | if (args.getReverse()) { | ||||
| @@ -43,6 +44,7 @@ public final class SunNative2Ascii extends DefaultNative2Ascii { | |||||
| super.setup(cmd, args); | super.setup(cmd, args); | ||||
| } | } | ||||
| /** {@inheritDoc} */ | |||||
| protected boolean run(Commandline cmd, ProjectComponent log) | protected boolean run(Commandline cmd, ProjectComponent log) | ||||
| throws BuildException { | throws BuildException { | ||||
| try { | try { | ||||