org.apache.sling.commons.compiler
Interface CompilationResult

All Known Implementing Classes:
CompilationResultImpl

public interface CompilationResult

The compilation result allows clients of the java compiler to check for error messages, warnings (if not disabled by the options) and allows to access the compiled classes.

Since:
2.0

Method Summary
 boolean didCompile()
          Was a compilation required or were all classes recent?
 java.util.List<CompilerMessage> getErrors()
          Return a list of error messages that occured during compilation.
 java.util.List<CompilerMessage> getWarnings()
          Return a list of warnings that occured during compilation.
 java.lang.Class<?> loadCompiledClass(java.lang.String className)
          Try to load the compiled class.
 

Method Detail

getErrors

java.util.List<CompilerMessage> getErrors()
Return a list of error messages that occured during compilation. If no errors occured null is returned.

Returns:
A list of error messages or null.

getWarnings

java.util.List<CompilerMessage> getWarnings()
Return a list of warnings that occured during compilation. If no warnings occured null is returned.

Returns:
A list of warnings or null.

didCompile

boolean didCompile()
Was a compilation required or were all classes recent?

Returns:
true>/code> if classes were compiled.

loadCompiledClass

java.lang.Class<?> loadCompiledClass(java.lang.String className)
                                     throws java.lang.ClassNotFoundException
Try to load the compiled class. The class loading might fail if the className is not one of the compiled sources, if the compilation failed or if a class loader writer has been used in combination with a class loader that is not able to load the classes written by the class loader writer.

Returns:
The compiled class
Throws:
java.lang.ClassNotFoundException - If the class could not be found or compilation failed.


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.