org.apache.tools.ant.taskdefs.rmic

Class DefaultRmicAdapter

public abstract class DefaultRmicAdapter extends Object implements RmicAdapter

This is the default implementation for the RmicAdapter interface. Currently, this is a cut-and-paste of the original rmic task and DefaultCopmpilerAdapter.

Since: Ant 1.4

Field Summary
static StringRMI_SKEL_SUFFIX
suffix denoting a skel file:
static StringRMI_STUB_SUFFIX
suffix denoting a stub file:
static StringRMI_TIE_SUFFIX
suffix denoting a tie file:
static StringSTUB_1_1
arg for 1.1:
static StringSTUB_1_2
arg for 1.2:
static StringSTUB_COMPAT
arg for compat:
static StringSTUB_OPTION_1_1
option for stub 1.1 in the rmic task:
static StringSTUB_OPTION_1_2
option for stub 1.2 in the rmic task:
static StringSTUB_OPTION_COMPAT
option for stub compat in the rmic task:
Constructor Summary
DefaultRmicAdapter()
Default constructor
Method Summary
protected StringaddStubVersionOptions()
This is an override point; get the stub version off the rmic command and translate that into a compiler-specific argument
protected String[]filterJvmCompilerArgs(String[] compilerArgs)
Strip out all -J args from the command list.
PathgetClasspath()
Gets the CLASSPATH this rmic process will use.
protected PathgetCompileClasspath()
Builds the compilation classpath.
FileNameMappergetMapper()
This implementation returns a mapper that may return up to two file names.
RmicgetRmic()
Get the Rmic attributes
protected StringgetSkelClassSuffix()
Gets the skeleton class suffix
protected StringgetStubClassSuffix()
Gets the stub class suffix
protected StringgetTieClassSuffix()
Gets the tie class suffix
protected voidlogAndAddFilesToCompile(Commandline cmd)
Logs the compilation parameters, adds the files to compile and logs the "niceSourceList"
protected String[]preprocessCompilerArgs(String[] compilerArgs)
Preprocess the compiler arguments in any way you see fit.
voidsetRmic(Rmic attributes)
Sets Rmic attributes
protected CommandlinesetupRmicCommand()
Setup rmic argument for rmic.
protected CommandlinesetupRmicCommand(String[] options)
Setup rmic argument for rmic.

Field Detail

RMI_SKEL_SUFFIX

public static final String RMI_SKEL_SUFFIX
suffix denoting a skel file: {@value }

RMI_STUB_SUFFIX

public static final String RMI_STUB_SUFFIX
suffix denoting a stub file: {@value }

RMI_TIE_SUFFIX

public static final String RMI_TIE_SUFFIX
suffix denoting a tie file: {@value }

STUB_1_1

public static final String STUB_1_1
arg for 1.1: {@value }

STUB_1_2

public static final String STUB_1_2
arg for 1.2: {@value }

STUB_COMPAT

public static final String STUB_COMPAT
arg for compat: {@value }

STUB_OPTION_1_1

public static final String STUB_OPTION_1_1
option for stub 1.1 in the rmic task: {@value }

STUB_OPTION_1_2

public static final String STUB_OPTION_1_2
option for stub 1.2 in the rmic task: {@value }

STUB_OPTION_COMPAT

public static final String STUB_OPTION_COMPAT
option for stub compat in the rmic task: {@value }

Constructor Detail

DefaultRmicAdapter

public DefaultRmicAdapter()
Default constructor

Method Detail

addStubVersionOptions

protected String addStubVersionOptions()
This is an override point; get the stub version off the rmic command and translate that into a compiler-specific argument

Returns: a string to use for the stub version; can be null

Since: Ant1.7.1

filterJvmCompilerArgs

protected String[] filterJvmCompilerArgs(String[] compilerArgs)
Strip out all -J args from the command list. Invoke this from (String[]) if you have a non-forking compiler.

Parameters: compilerArgs the original compiler arguments

Returns: the filtered set.

getClasspath

public Path getClasspath()
Gets the CLASSPATH this rmic process will use.

Returns: the classpath

getCompileClasspath

protected Path getCompileClasspath()
Builds the compilation classpath.

Returns: the classpath

getMapper

public FileNameMapper getMapper()
This implementation returns a mapper that may return up to two file names.

Returns: a FileNameMapper

getRmic

public Rmic getRmic()
Get the Rmic attributes

Returns: the attributes as a Rmic taskdef

getSkelClassSuffix

protected String getSkelClassSuffix()
Gets the skeleton class suffix

Returns: the skeleton suffix "_Skel"

getStubClassSuffix

protected String getStubClassSuffix()
Gets the stub class suffix

Returns: the stub suffix "_Stub"

getTieClassSuffix

protected String getTieClassSuffix()
Gets the tie class suffix

Returns: the tie suffix "_Tie"

logAndAddFilesToCompile

protected void logAndAddFilesToCompile(Commandline cmd)
Logs the compilation parameters, adds the files to compile and logs the "niceSourceList"

Parameters: cmd the commandline args

preprocessCompilerArgs

protected String[] preprocessCompilerArgs(String[] compilerArgs)
Preprocess the compiler arguments in any way you see fit. This is to allow compiler adapters to validate or filter the arguments. The base implementation returns the original compiler arguments unchanged.

Parameters: compilerArgs the original compiler arguments

Returns: the filtered set.

setRmic

public void setRmic(Rmic attributes)
Sets Rmic attributes

Parameters: attributes the rmic attributes

setupRmicCommand

protected Commandline setupRmicCommand()
Setup rmic argument for rmic.

Returns: the command line

setupRmicCommand

protected Commandline setupRmicCommand(String[] options)
Setup rmic argument for rmic.

Parameters: options additional parameters needed by a specific implementation.

Returns: the command line