Top Description Inners Fields Constructors Methods
org.apache.tools.ant.taskdefs.rmic

public abstract Class DefaultRmicAdapter

extends Object
implements RmicAdapter
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.rmic.RmicAdapter
Known Direct Subclasses
org.apache.tools.ant.taskdefs.rmic.ForkingSunRmic, org.apache.tools.ant.taskdefs.rmic.KaffeRmic, org.apache.tools.ant.taskdefs.rmic.SunRmic, org.apache.tools.ant.taskdefs.rmic.WLRmic
Imports
java.io.File, java.util.ArrayList, .List, .Random, .Vector, java.util.stream.Collectors, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.Rmic, org.apache.tools.ant.types.Commandline, .Path, org.apache.tools.ant.util.FileNameMapper, .JavaEnvUtils, .StringUtils

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
DefaultRmicAdapter.RmicFileNameMapper

Mapper that may return up to two file names.

Field Summary

Modifier and TypeField and Description
private Rmic
private FileNameMapper
private static final Random
public static final String
RMI_SKEL_SUFFIX

suffix denoting a skel file: _Skel

public static final String
RMI_STUB_SUFFIX

suffix denoting a stub file: _Stub

public static final String
RMI_TIE_SUFFIX

suffix denoting a tie file: _Tie

public static final String
STUB_1_1

arg for 1.1: -v1.1

public static final String
STUB_1_2

arg for 1.2: -v1.2

public static final String
STUB_COMPAT

arg for compat: -vcompat

public static final String
STUB_OPTION_1_1

option for stub 1.1 in the rmic task: 1.1

public static final String
STUB_OPTION_1_2

option for stub 1.2 in the rmic task: 1.2

public static final String
STUB_OPTION_COMPAT

option for stub compat in the rmic task: compat

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

a string to use for the stub version; can be null
addStubVersionOptions
()

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

protected boolean

Returns:

true if the iiop and idl switches are supported
areIiopAndIdlSupported
()

Whether the iiop and idl switches are supported.

protected String[]

Returns:

the filtered set.
filterJvmCompilerArgs
(String[]
the original compiler arguments
compilerArgs
)

Strip out all -J args from the command list.

public Path

Returns:

the classpath
getClasspath
()

Implements org.apache.tools.ant.taskdefs.rmic.RmicAdapter.getClasspath.

Gets the CLASSPATH this rmic process will use.
protected Path

Returns:

the classpath
getCompileClasspath
()

Builds the compilation classpath.

public FileNameMapper

Returns:

a FileNameMapper
getMapper
()

Implements org.apache.tools.ant.taskdefs.rmic.RmicAdapter.getMapper.

This implementation returns a mapper that may return up to two file names.
public Rmic

Returns:

the attributes as a Rmic taskdef
getRmic
()

Get the Rmic attributes

protected String

Returns:

the skeleton suffix "_Skel"
getSkelClassSuffix
()

Gets the skeleton class suffix

protected String

Returns:

the stub suffix "_Stub"
getStubClassSuffix
()

Gets the stub class suffix

protected String

Returns:

the tie suffix "_Tie"
getTieClassSuffix
()

Gets the tie class suffix

protected void
logAndAddFilesToCompile(Commandline
the commandline args
cmd
)

Logs the compilation parameters, adds the files to compile and logs the "niceSourceList"

protected String[]

Returns:

the filtered set.
preprocessCompilerArgs
(String[]
the original compiler arguments
compilerArgs
)

Preprocess the compiler arguments in any way you see fit.

public void
setRmic(final Rmic
the rmic attributes
attributes
)

Implements org.apache.tools.ant.taskdefs.rmic.RmicAdapter.setRmic.

Sets Rmic attributes
protected Commandline

Returns:

the command line
setupRmicCommand
()

Setup rmic argument for rmic.

protected Commandline

Returns:

the command line
setupRmicCommand
(String[]
additional parameters needed by a specific implementation.
options
)

Setup rmic argument for rmic.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributesback to summary
private Rmic attributes
mapperback to summary
private FileNameMapper mapper
RANDback to summary
private static final Random RAND
RMI_SKEL_SUFFIXback to summary
public static final String RMI_SKEL_SUFFIX

suffix denoting a skel file: _Skel

RMI_STUB_SUFFIXback to summary
public static final String RMI_STUB_SUFFIX

suffix denoting a stub file: _Stub

RMI_TIE_SUFFIXback to summary
public static final String RMI_TIE_SUFFIX

suffix denoting a tie file: _Tie

STUB_1_1back to summary
public static final String STUB_1_1

arg for 1.1: -v1.1

STUB_1_2back to summary
public static final String STUB_1_2

arg for 1.2: -v1.2

STUB_COMPATback to summary
public static final String STUB_COMPAT

arg for compat: -vcompat

STUB_OPTION_1_1back to summary
public static final String STUB_OPTION_1_1

option for stub 1.1 in the rmic task: 1.1

STUB_OPTION_1_2back to summary
public static final String STUB_OPTION_1_2

option for stub 1.2 in the rmic task: 1.2

STUB_OPTION_COMPATback to summary
public static final String STUB_OPTION_COMPAT

option for stub compat in the rmic task: compat

Constructor Detail

DefaultRmicAdapterback to summary
public DefaultRmicAdapter()

Method Detail

addStubVersionOptionsback to summary
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:String

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

Since
Ant1.7.1
areIiopAndIdlSupportedback to summary
protected boolean areIiopAndIdlSupported()

Whether the iiop and idl switches are supported.

This implementation returns false if running on Java 11 onwards and true otherwise.

Returns:boolean

true if the iiop and idl switches are supported

Since
Ant 1.10.3
filterJvmCompilerArgsback to summary
protected String[] filterJvmCompilerArgs(String[] compilerArgs)

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

Parameters
compilerArgs:String[]

the original compiler arguments

Returns:String[]

the filtered set.

getClasspathback to summary
public Path getClasspath()

Implements org.apache.tools.ant.taskdefs.rmic.RmicAdapter.getClasspath.

Gets the CLASSPATH this rmic process will use.

Returns:Path

the classpath

Annotations
@Override
getCompileClasspathback to summary
protected Path getCompileClasspath()

Builds the compilation classpath.

Returns:Path

the classpath

getMapperback to summary
public FileNameMapper getMapper()

Implements org.apache.tools.ant.taskdefs.rmic.RmicAdapter.getMapper.

This implementation returns a mapper that may return up to two file names.

  • for JRMP it will return *_getStubClassSuffix (and *_getSkelClassSuffix if JDK 1.1 is used)
  • for IDL it will return a random name, causing <rmic> to always recompile.
  • for IIOP it will return _*_getStubClassSuffix for interfaces and _*_getStubClassSuffix for non-interfaces (and determine the interface and create _*_Stub from that).
Returns:FileNameMapper

a FileNameMapper

Annotations
@Override
getRmicback to summary
public Rmic getRmic()

Get the Rmic attributes

Returns:Rmic

the attributes as a Rmic taskdef

getSkelClassSuffixback to summary
protected String getSkelClassSuffix()

Gets the skeleton class suffix

Returns:String

the skeleton suffix "_Skel"

getStubClassSuffixback to summary
protected String getStubClassSuffix()

Gets the stub class suffix

Returns:String

the stub suffix "_Stub"

getTieClassSuffixback to summary
protected String getTieClassSuffix()

Gets the tie class suffix

Returns:String

the tie suffix "_Tie"

logAndAddFilesToCompileback to summary
protected void logAndAddFilesToCompile(Commandline cmd)

Logs the compilation parameters, adds the files to compile and logs the "niceSourceList"

Parameters
cmd:Commandline

the commandline args

preprocessCompilerArgsback to summary
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:String[]

the original compiler arguments

Returns:String[]

the filtered set.

setRmicback to summary
public void setRmic(final Rmic attributes)

Implements org.apache.tools.ant.taskdefs.rmic.RmicAdapter.setRmic.

Sets Rmic attributes

Parameters
attributes:Rmic

the rmic attributes

Annotations
@Override
setupRmicCommandback to summary
protected Commandline setupRmicCommand()

Setup rmic argument for rmic.

Returns:Commandline

the command line

setupRmicCommandback to summary
protected Commandline setupRmicCommand(String[] options)

Setup rmic argument for rmic.

Parameters
options:String[]

additional parameters needed by a specific implementation.

Returns:Commandline

the command line

verifyArgumentsback to summary
private void verifyArguments(Commandline cmd)
org.apache.tools.ant.taskdefs.rmic back to summary

private Class DefaultRmicAdapter.RmicFileNameMapper

extends Object
implements FileNameMapper
Class Inheritance
  • java.lang.Object
  • org.apache.tools.ant.taskdefs.rmic.DefaultRmicAdapter.RmicFileNameMapper
All Implemented Interfaces
org.apache.tools.ant.util.FileNameMapper

Mapper that may return up to two file names.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String[]
mapFileName(String
the name of the source file relative to some given basedirectory. Might be null for resources that don't provide a name.
name
)

Implements org.apache.tools.ant.util.FileNameMapper.mapFileName.

Returns an array containing the target filename(s) for the given source file.
public void
setFrom(String
a string.
s
)

Implements org.apache.tools.ant.util.FileNameMapper.setFrom.

Empty implementation.
public void
setTo(String
a string.
s
)

Implements org.apache.tools.ant.util.FileNameMapper.setTo.

Empty implementation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RmicFileNameMapperback to summary
private RmicFileNameMapper()

Method Detail

mapFileNameback to summary
public String[] mapFileName(String name)

Implements org.apache.tools.ant.util.FileNameMapper.mapFileName.

Doc from org.apache.tools.ant.util.FileNameMapper.mapFileName.

Returns an array containing the target filename(s) for the given source file.

if the given rule doesn't apply to the source file, implementation must return null. SourceFileScanner will then omit the source file in question.

Parameters
name:String

the name of the source file relative to some given basedirectory. Might be null for resources that don't provide a name.

Returns:String[]

an array of strings if the rule applies to the source file, or null if it does not.

Annotations
@Override
setFromback to summary
public void setFrom(String s)

Implements org.apache.tools.ant.util.FileNameMapper.setFrom.

Empty implementation.

Parameters
s:String

Doc from org.apache.tools.ant.util.FileNameMapper.setFrom.

a string.

Annotations
@Override
setToback to summary
public void setTo(String s)

Implements org.apache.tools.ant.util.FileNameMapper.setTo.

Empty implementation.

Parameters
s:String

Doc from org.apache.tools.ant.util.FileNameMapper.setTo.

a string.

Annotations
@Override