|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openide.compiler.Compiler | +--org.openide.compiler.ExternalCompiler
Compiles (probably Java) sources via an external compiler process. The path to the executable, classpath, error-matching expressions, etc. are configurable.
Inner Class Summary | |
static class |
ExternalCompiler.ErrorExpression
Encapsulates several properties needed for processing the error output of an external compiler. |
Inner classes inherited from class org.openide.compiler.Compiler |
Compiler.Depth |
Field Summary | |
static Object |
BUILD
Constant for building. |
protected static String |
CLASS_EXTENSION
File extension for class files. |
static Object |
CLEAN
Constant for cleaning. |
static Object |
COMPILE
Constant for compilation. |
static ExternalCompiler.ErrorExpression |
JAVAC
Error parsing for Sun's Javac. |
static ExternalCompiler.ErrorExpression |
JIKES
Error parsing for IBM's Jikes (with the +E switch). |
static ExternalCompiler.ErrorExpression |
JVC
Error parsing for Microsoft's JVC. |
Fields inherited from class org.openide.compiler.Compiler |
DEPTH_INFINITE, DEPTH_ONE, DEPTH_ZERO |
Fields inherited from interface org.openide.compiler.Compilable |
MUTEX |
Constructor Summary | |
ExternalCompiler(Compiler[] dependencies,
FileObject fo,
Object type,
NbProcessDescriptor nbDescriptor,
ExternalCompiler.ErrorExpression err)
Create an external compiler with dependencies. |
|
ExternalCompiler(CompilerJob job,
FileObject fo,
Object type,
NbProcessDescriptor nbDescriptor,
ExternalCompiler.ErrorExpression err)
Create an external compiler. |
|
ExternalCompiler(File file,
Object type,
NbProcessDescriptor nbDescriptor,
ExternalCompiler.ErrorExpression err)
Create an external compiler for a given java.io.File. |
|
ExternalCompiler(FileObject fo,
Object type,
NbProcessDescriptor nbDescriptor,
ExternalCompiler.ErrorExpression err)
Create an external compiler. |
|
ExternalCompiler(FileSystem fs,
String resourceName,
Object type,
NbProcessDescriptor nbDescriptor,
ExternalCompiler.ErrorExpression err)
Create an external compiler for an object in repository that still does not exists. |
|
ExternalCompiler(String resourceName,
Object type,
NbProcessDescriptor nbDescriptor,
ExternalCompiler.ErrorExpression err)
Create an external compiler for an object in repository need not exist in present. |
Method Summary | |
Class |
compilerGroupClass()
Get the associated CompilerGroup container class. |
Object |
compilerGroupKey()
Produce a refined key for external compilers. |
protected Object |
compilerType()
Deprecated. While subclassing this method and specifying a type will still work, it is no longer recommended. Instead, please use Compiler.compilerGroupKey()
and make all compiler-specific state available to the compiler group via other means
(such as getter methods). |
boolean |
equals(Object o)
Two external compilers are the same if they have been constructed with the same arguments. |
NbProcessDescriptor |
getCompilerDescriptor()
Get the description of the compiler executable. |
ExternalCompiler.ErrorExpression |
getErrorExpression()
Get the error expression used to parse error output from this compiler. |
String |
getFileName()
Get the name of the file to be compiled. |
protected FileObject |
getFileObject()
Get the file object to be compiled |
int |
hashCode()
|
protected boolean |
isUpToDate()
Check whether the compiler is up to date. |
String |
toString()
|
Methods inherited from class org.openide.compiler.Compiler |
compilers, dependsOn, dependsOn, dependsOn |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final ExternalCompiler.ErrorExpression JAVAC
public static final ExternalCompiler.ErrorExpression JVC
public static final ExternalCompiler.ErrorExpression JIKES
+E
switch).public static final Object COMPILE
public static final Object BUILD
public static final Object CLEAN
protected static final String CLASS_EXTENSION
Constructor Detail |
public ExternalCompiler(FileObject fo, Object type, NbProcessDescriptor nbDescriptor, ExternalCompiler.ErrorExpression err)
fo
- a file to compiletype
- the type of compilation (COMPILE
or BUILD
)nbDescriptor
- a description of an external compiler executableerr
- a regular expression to scan for compiler errorsIllegalArgumentException
- if the file object is invalidpublic ExternalCompiler(CompilerJob job, FileObject fo, Object type, NbProcessDescriptor nbDescriptor, ExternalCompiler.ErrorExpression err)
job
- the compiler job to add tofo
- a file to compiletype
- the type of compilation (COMPILE
or BUILD
)nbDescriptor
- a description of an external compiler executableerr
- a regular expression to scan for compiler errorsIllegalArgumentException
- if the file object is invalidpublic ExternalCompiler(Compiler[] dependencies, FileObject fo, Object type, NbProcessDescriptor nbDescriptor, ExternalCompiler.ErrorExpression err)
dependencies
- an array of compilers that are to be invoked before this one.fo
- a file to compiletype
- the type of compilation (COMPILE
or BUILD
)nbDescriptor
- a description of an external compiler executableerr
- a regular expression to scan for compiler errorsIllegalArgumentException
- if the file object is invalidpublic ExternalCompiler(File file, Object type, NbProcessDescriptor nbDescriptor, ExternalCompiler.ErrorExpression err)
file
- the file to compiletype
- the type of compilation (COMPILE
or BUILD
)nbDescriptor
- a description of an external compiler executableerr
- a regular expression to scan for compiler errorspublic ExternalCompiler(FileSystem fs, String resourceName, Object type, NbProcessDescriptor nbDescriptor, ExternalCompiler.ErrorExpression err)
fs
- file system to look on for resourceresourceName
- the name of resource to look fortype
- the type of compilation (COMPILE
or BUILD
)nbDescriptor
- a description of an external compiler executableerr
- a regular expression to scan for compiler errorspublic ExternalCompiler(String resourceName, Object type, NbProcessDescriptor nbDescriptor, ExternalCompiler.ErrorExpression err)
resourceName
- the name of resource to look fortype
- the type of compilation (COMPILE
or BUILD
)nbDescriptor
- a description of an external compiler executableerr
- a regular expression to scan for compiler errorsMethod Detail |
public final NbProcessDescriptor getCompilerDescriptor()
public final ExternalCompiler.ErrorExpression getErrorExpression()
protected final FileObject getFileObject()
public String getFileName()
protected boolean isUpToDate()
Compiler
CompilerJob.isUpToDate()
to skip a compilation when it is unnecessary.isUpToDate
in class Compiler
org.openide.compiler.Compiler
true
if up-to-date; false
if compilation is neededpublic String toString()
toString
in class Object
public Class compilerGroupClass()
Compiler
CompilerGroup
container class.
The compiler and compiler group should typically be implemented in parallel,
though it is possible to subclass a compiler without subclassing the compiler group.
The compiler group must be "expecting" a compiler of this class (or a superclass), or else
it is free to fail in an unspecified way.
All instances of the same compiler class must return the same result from this method.compilerGroupClass
in class Compiler
protected Object compilerType()
Compiler.compilerGroupKey()
and make all compiler-specific state available to the compiler group via other means
(such as getter methods).
It is necessary for all compilers of the same type to have same process descriptor and error expression.
This implementation returns the process descriptor, so all compilers with the same descriptor will be compiled at once.
Note that this method has no relation to CompilerType
s; the name is incidental.
ExternalCompilerGroup.createProcess(org.openide.execution.NbProcessDescriptor, java.lang.String[], java.lang.Object)
public Object compilerGroupKey()
compilerType()
as well,
and also by the error description.
Specialized external compilers are encouraged to override this method directly according to the
contract specified in Compiler.compilerGroupKey()
.compilerGroupKey
in class Compiler
public boolean equals(Object o)
equals
in class Object
org.openide.compiler.Compilable
other
- the other objectpublic int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |