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 CompilerOutputStyle
compilerOutputStyle
protected static java.lang.String
EOL
private java.lang.String
inputFileEnding
private java.lang.String
outputFile
private java.lang.String
outputFileEnding
protected static java.lang.String
PS
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCompiler(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 boolean
canUpdateTarget(CompilerConfiguration configuration)
java.util.List<CompilerError>
compile(CompilerConfiguration configuration)
Deprecated.private static java.lang.String
getCanonicalPath(java.io.File origFile)
CompilerOutputStyle
getCompilerOutputStyle()
java.lang.String
getInputFileEnding(CompilerConfiguration configuration)
java.lang.String
getOutputFile(CompilerConfiguration configuration)
java.lang.String
getOutputFileEnding(CompilerConfiguration configuration)
static java.lang.String
getPathString(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.String
makeClassName(java.lang.String fileName, java.lang.String sourceDir)
CompilerResult
performCompile(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:Compiler
Performs the compilation of the project. Clients must implement this method.- Specified by:
performCompile
in 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:Compiler
This method is provided for backwards compatibility only. Clients should useCompiler.performCompile(CompilerConfiguration)
instead.- Specified by:
compile
in 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:
getCompilerOutputStyle
in interfaceCompiler
-
getInputFileEnding
public java.lang.String getInputFileEnding(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getInputFileEnding
in interfaceCompiler
- Throws:
CompilerException
-
getOutputFileEnding
public java.lang.String getOutputFileEnding(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getOutputFileEnding
in interfaceCompiler
- Throws:
CompilerException
-
getOutputFile
public java.lang.String getOutputFile(CompilerConfiguration configuration) throws CompilerException
- Specified by:
getOutputFile
in interfaceCompiler
- Throws:
CompilerException
-
canUpdateTarget
public boolean canUpdateTarget(CompilerConfiguration configuration) throws CompilerException
- Specified by:
canUpdateTarget
in 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
-
-