Class CompilerAdapterFactory
- java.lang.Object
-
- org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory
-
public final class CompilerAdapterFactory extends java.lang.ObjectCreates the necessary compiler adapter, given basic criteria.- Since:
- Ant 1.3
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOMPILER_CLASSICstatic java.lang.StringCOMPILER_EXTJAVACstatic java.lang.StringCOMPILER_EXTJAVAC_CLASSNAMEstatic java.lang.StringCOMPILER_GCJstatic java.lang.StringCOMPILER_JAVAC_1_1static java.lang.StringCOMPILER_JAVAC_1_2static java.lang.StringCOMPILER_JAVAC_1_3static java.lang.StringCOMPILER_JAVAC_1_4static java.lang.StringCOMPILER_JAVAC_1_5static java.lang.StringCOMPILER_JAVAC_1_6static java.lang.StringCOMPILER_JAVAC_1_7static java.lang.StringCOMPILER_JAVAC_1_8static java.lang.StringCOMPILER_JAVAC_10_PLUSstatic java.lang.StringCOMPILER_JAVAC_9static java.lang.StringCOMPILER_JAVAC_9_ALIASstatic java.lang.StringCOMPILER_JIKESstatic java.lang.StringCOMPILER_JVCstatic java.lang.StringCOMPILER_JVC_ALIASstatic java.lang.StringCOMPILER_KJCstatic java.lang.StringCOMPILER_MODERNstatic java.lang.StringCOMPILER_MODERN_CLASSNAMEstatic java.lang.StringCOMPILER_SYMANTECstatic java.lang.StringCOMPILER_SYMANTEC_ALIAS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CompilerAdaptergetCompiler(java.lang.String compilerType, Task task)Based on the parameter passed in, this method creates the necessary factory desired.static CompilerAdaptergetCompiler(java.lang.String compilerType, Task task, Path classpath)Based on the parameter passed in, this method creates the necessary factory desired.static booleanisClassicJdkCompiler(java.lang.String compilerName)Does the compiler correspond to "classic"?static booleanisForkedJavac(java.lang.String compilerName)Is the compiler implementation a forked jdk compiler?static booleanisJdkCompiler(java.lang.String compilerName)Is the compiler implementation a jdk compiler?static booleanisJdkCompilerNickname(java.lang.String compilerName)Is the compiler implementation a jdk compiler without specified version?static booleanisModernJdkCompiler(java.lang.String compilerName)Does the compiler correspond to "modern"?
-
-
-
Field Detail
-
COMPILER_JIKES
public static final java.lang.String COMPILER_JIKES
- See Also:
- Constant Field Values
-
COMPILER_GCJ
public static final java.lang.String COMPILER_GCJ
- See Also:
- Constant Field Values
-
COMPILER_SYMANTEC_ALIAS
public static final java.lang.String COMPILER_SYMANTEC_ALIAS
- See Also:
- Constant Field Values
-
COMPILER_SYMANTEC
public static final java.lang.String COMPILER_SYMANTEC
- See Also:
- Constant Field Values
-
COMPILER_JVC_ALIAS
public static final java.lang.String COMPILER_JVC_ALIAS
- See Also:
- Constant Field Values
-
COMPILER_JVC
public static final java.lang.String COMPILER_JVC
- See Also:
- Constant Field Values
-
COMPILER_KJC
public static final java.lang.String COMPILER_KJC
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_1_1
public static final java.lang.String COMPILER_JAVAC_1_1
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_1_2
public static final java.lang.String COMPILER_JAVAC_1_2
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_1_3
public static final java.lang.String COMPILER_JAVAC_1_3
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_1_4
public static final java.lang.String COMPILER_JAVAC_1_4
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_1_5
public static final java.lang.String COMPILER_JAVAC_1_5
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_1_6
public static final java.lang.String COMPILER_JAVAC_1_6
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_1_7
public static final java.lang.String COMPILER_JAVAC_1_7
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_1_8
public static final java.lang.String COMPILER_JAVAC_1_8
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_9_ALIAS
public static final java.lang.String COMPILER_JAVAC_9_ALIAS
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_9
public static final java.lang.String COMPILER_JAVAC_9
- See Also:
- Constant Field Values
-
COMPILER_JAVAC_10_PLUS
public static final java.lang.String COMPILER_JAVAC_10_PLUS
- See Also:
- Constant Field Values
-
COMPILER_CLASSIC
public static final java.lang.String COMPILER_CLASSIC
- See Also:
- Constant Field Values
-
COMPILER_MODERN
public static final java.lang.String COMPILER_MODERN
- See Also:
- Constant Field Values
-
COMPILER_EXTJAVAC
public static final java.lang.String COMPILER_EXTJAVAC
- See Also:
- Constant Field Values
-
COMPILER_MODERN_CLASSNAME
public static final java.lang.String COMPILER_MODERN_CLASSNAME
-
COMPILER_EXTJAVAC_CLASSNAME
public static final java.lang.String COMPILER_EXTJAVAC_CLASSNAME
-
-
Method Detail
-
getCompiler
public static CompilerAdapter getCompiler(java.lang.String compilerType, Task task) throws BuildException
Based on the parameter passed in, this method creates the necessary factory desired. The current mapping for compiler names are as follows:- jikes = jikes compiler
- classic, javac1.1, javac1.2 = the standard compiler from JDK 1.1/1.2
- modern, javac1.3, javac1.4, javac1.5 = the compiler of JDK 1.3+
- jvc, microsoft = the command line compiler from Microsoft's SDK for Java / Visual J++
- kjc = the kopi compiler
- gcj = the gcj compiler from gcc
- sj, symantec = the Symantec Java compiler
- a fully qualified classname = the name of a compiler adapter
- Parameters:
compilerType- either the name of the desired compiler, or the full classname of the compiler's adapter.task- a task to log through.- Returns:
- the compiler adapter
- Throws:
BuildException- if the compiler type could not be resolved into a compiler adapter.
-
getCompiler
public static CompilerAdapter getCompiler(java.lang.String compilerType, Task task, Path classpath) throws BuildException
Based on the parameter passed in, this method creates the necessary factory desired. The current mapping for compiler names are as follows:- jikes = jikes compiler
- classic, javac1.1, javac1.2 = the standard compiler from JDK 1.1/1.2
- modern, javac1.3, javac1.4, javac1.5 = the compiler of JDK 1.3+
- jvc, microsoft = the command line compiler from Microsoft's SDK for Java / Visual J++
- kjc = the kopi compiler
- gcj = the gcj compiler from gcc
- sj, symantec = the Symantec Java compiler
- a fully qualified classname = the name of a compiler adapter
- Parameters:
compilerType- either the name of the desired compiler, or the full classname of the compiler's adapter.task- a task to log through.classpath- the classpath to use when looking up an adapter class- Returns:
- the compiler adapter
- Throws:
BuildException- if the compiler type could not be resolved into a compiler adapter.- Since:
- Ant 1.8.0
-
isForkedJavac
public static boolean isForkedJavac(java.lang.String compilerName)
Is the compiler implementation a forked jdk compiler?- Parameters:
compilerImpl- the name of the compiler implementation- Since:
- 1.10.12
-
isJdkCompiler
public static boolean isJdkCompiler(java.lang.String compilerName)
Is the compiler implementation a jdk compiler?- Parameters:
compilerImpl- the name of the compiler implementation- Since:
- 1.10.12
-
isJdkCompilerNickname
public static boolean isJdkCompilerNickname(java.lang.String compilerName)
Is the compiler implementation a jdk compiler without specified version?- Parameters:
compilerImpl- the name of the compiler implementation- Since:
- 1.10.12
-
isClassicJdkCompiler
public static boolean isClassicJdkCompiler(java.lang.String compilerName)
Does the compiler correspond to "classic"?- Parameters:
compilerImpl- the name of the compiler implementation- Since:
- 1.10.12
-
isModernJdkCompiler
public static boolean isModernJdkCompiler(java.lang.String compilerName)
Does the compiler correspond to "modern"?- Parameters:
compilerImpl- the name of the compiler implementation- Since:
- 1.10.12
-
-