Package org.codehaus.plexus.compiler
Class AbstractCompiler
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.codehaus.plexus.compiler.AbstractCompiler
-
- All Implemented Interfaces:
Compiler,org.codehaus.plexus.logging.LogEnabled
- Direct Known Subclasses:
CSharpCompiler,J2ObjCCompiler,JavacCompiler,JikesCompiler
public abstract class AbstractCompiler extends org.codehaus.plexus.logging.AbstractLogEnabled implements Compiler
-
-
Field Summary
Fields Modifier and Type Field Description private CompilerOutputStylecompilerOutputStyleprotected static java.lang.StringEOLprivate java.lang.StringinputFileEndingprivate java.lang.StringoutputFileprivate java.lang.StringoutputFileEndingprotected static java.lang.StringPS
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCompiler(CompilerOutputStyle compilerOutputStyle, java.lang.String inputFileEnding, java.lang.String outputFileEnding, java.lang.String outputFile)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancanUpdateTarget(CompilerConfiguration configuration)java.util.List<CompilerError>compile(CompilerConfiguration configuration)Deprecated.private static java.lang.StringgetCanonicalPath(java.io.File origFile)CompilerOutputStylegetCompilerOutputStyle()java.lang.StringgetInputFileEnding(CompilerConfiguration configuration)java.lang.StringgetOutputFile(CompilerConfiguration configuration)java.lang.StringgetOutputFileEnding(CompilerConfiguration configuration)static java.lang.StringgetPathString(java.util.List<java.lang.String> pathElements)protected static java.lang.String[]getSourceFiles(CompilerConfiguration config)protected static java.util.Set<java.lang.String>getSourceFilesForSourceRoot(CompilerConfiguration config, java.lang.String sourceLocation)protected static java.lang.StringmakeClassName(java.lang.String fileName, java.lang.String sourceDir)CompilerResultperformCompile(CompilerConfiguration configuration)Performs the compilation of the project.protected static java.lang.String[]toStringArray(java.util.List<java.lang.String> arguments)Deprecated.use (String[]) arguments.toArray( new String[ arguments.size() ] ); instead-
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.plexus.compiler.Compiler
createCommandLine
-
-
-
-
Field Detail
-
EOL
protected static final java.lang.String EOL
-
PS
protected static final java.lang.String PS
-
compilerOutputStyle
private CompilerOutputStyle compilerOutputStyle
-
inputFileEnding
private java.lang.String inputFileEnding
-
outputFileEnding
private java.lang.String outputFileEnding
-
outputFile
private java.lang.String outputFile
-
-
Constructor Detail
-
AbstractCompiler
protected AbstractCompiler(CompilerOutputStyle compilerOutputStyle, java.lang.String inputFileEnding, java.lang.String outputFileEnding, java.lang.String outputFile)
-
-
Method Detail
-
performCompile
public CompilerResult performCompile(CompilerConfiguration configuration) throws CompilerException
Description copied from interface:CompilerPerforms the compilation of the project. Clients must implement this method.- Specified by:
performCompilein interfaceCompiler- Parameters:
configuration- the configuration description of the compilation to perform- Returns:
- the result of the compilation returned by the language processor
- Throws:
CompilerException
-
compile
@Deprecated public java.util.List<CompilerError> compile(CompilerConfiguration configuration) throws CompilerException
Deprecated.Description copied from interface:CompilerThis method is provided for backwards compatibility only. Clients should useCompiler.performCompile(CompilerConfiguration)instead.- Specified by:
compilein interfaceCompiler- Parameters:
configuration- the configuration description of the compilation to perform- Returns:
- the result of the compilation returned by the language processor
- Throws:
CompilerException
-
getCompilerOutputStyle
public CompilerOutputStyle getCompilerOutputStyle()
- Specified by:
getCompilerOutputStylein interfaceCompiler
-
getInputFileEnding
public java.lang.String getInputFileEnding(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getInputFileEndingin interfaceCompiler- Throws:
CompilerException
-
getOutputFileEnding
public java.lang.String getOutputFileEnding(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getOutputFileEndingin interfaceCompiler- Throws:
CompilerException
-
getOutputFile
public java.lang.String getOutputFile(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getOutputFilein interfaceCompiler- Throws:
CompilerException
-
canUpdateTarget
public boolean canUpdateTarget(CompilerConfiguration configuration) throws CompilerException
- Specified by:
canUpdateTargetin interfaceCompiler- Throws:
CompilerException
-
getPathString
public static java.lang.String getPathString(java.util.List<java.lang.String> pathElements)
-
getSourceFilesForSourceRoot
protected static java.util.Set<java.lang.String> getSourceFilesForSourceRoot(CompilerConfiguration config, java.lang.String sourceLocation)
-
getSourceFiles
protected static java.lang.String[] getSourceFiles(CompilerConfiguration config)
-
makeClassName
protected static java.lang.String makeClassName(java.lang.String fileName, java.lang.String sourceDir) throws CompilerException- Throws:
CompilerException
-
getCanonicalPath
private static java.lang.String getCanonicalPath(java.io.File origFile) throws CompilerException- Throws:
CompilerException
-
toStringArray
protected static java.lang.String[] toStringArray(java.util.List<java.lang.String> arguments)
Deprecated.use (String[]) arguments.toArray( new String[ arguments.size() ] ); instead
-
-