FileDocCategorySizeDatePackage
KaffeNative2Ascii.javaAPI DocApache Ant 1.702953Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.taskdefs.optional.native2ascii

KaffeNative2Ascii

public final class KaffeNative2Ascii extends DefaultNative2Ascii
Adapter to kaffe.tools.native2ascii.Native2Ascii.
since
Ant 1.6.3

Fields Summary
private static final String[]
N2A_CLASSNAMES
public static final String
IMPLEMENTATION_NAME
Identifies this adapter.
Constructors Summary
Methods Summary
private static java.lang.ClassgetN2aClass()
tries to load Kaffe Native2Ascii and falls back to the older class name if necessary.

return
null if neither class can get loaded.

        for (int i = 0; i < N2A_CLASSNAMES.length; i++) {
            try {
                return Class.forName(N2A_CLASSNAMES[i]);
            } catch (ClassNotFoundException cnfe) {
                // Ignore
            }
        }
        return null;
    
protected booleanrun(org.apache.tools.ant.types.Commandline cmd, org.apache.tools.ant.ProjectComponent log)
{@inheritDoc}

        ExecuteJava ej = new ExecuteJava();
        Class c = getN2aClass();
        if (c == null) {
            throw new BuildException("Couldn't load Kaffe's Native2Ascii"
                                     + " class");
        }

        cmd.setExecutable(c.getName());
        ej.setJavaCommand(cmd);
        ej.execute(log.getProject());
        // otherwise ExecuteJava has thrown an exception
        return true;
    
protected voidsetup(org.apache.tools.ant.types.Commandline cmd, org.apache.tools.ant.taskdefs.optional.Native2Ascii args)
{@inheritDoc}


      
         
          
        if (args.getReverse()) {
            throw new BuildException("-reverse is not supported by Kaffe");
        }
        super.setup(cmd, args);