org.apache.sling.commons.compiler.impl
Class CompilationResultImpl

java.lang.Object
  extended by org.apache.sling.commons.compiler.impl.CompilationResultImpl
All Implemented Interfaces:
CompilationResult

public class CompilationResultImpl
extends java.lang.Object
implements CompilationResult

Implementation of the compilation result


Constructor Summary
CompilationResultImpl(boolean ignoreWarnings, org.apache.sling.commons.classloader.ClassLoaderWriter writer)
           
CompilationResultImpl(org.apache.sling.commons.classloader.ClassLoaderWriter writer)
           
CompilationResultImpl(java.lang.String errorMessage)
           
 
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.
 void onError(java.lang.String msg, java.lang.String sourceFile, int line, int position)
          Notification of an error
 void onWarning(java.lang.String msg, java.lang.String sourceFile, int line, int position)
          Notification of a warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompilationResultImpl

public CompilationResultImpl(java.lang.String errorMessage)

CompilationResultImpl

public CompilationResultImpl(org.apache.sling.commons.classloader.ClassLoaderWriter writer)

CompilationResultImpl

public CompilationResultImpl(boolean ignoreWarnings,
                             org.apache.sling.commons.classloader.ClassLoaderWriter writer)
Method Detail

getErrors

public java.util.List<CompilerMessage> getErrors()
Description copied from interface: CompilationResult
Return a list of error messages that occured during compilation. If no errors occured null is returned.

Specified by:
getErrors in interface CompilationResult
Returns:
A list of error messages or null.
See Also:
CompilationResult.getErrors()

getWarnings

public java.util.List<CompilerMessage> getWarnings()
Description copied from interface: CompilationResult
Return a list of warnings that occured during compilation. If no warnings occured null is returned.

Specified by:
getWarnings in interface CompilationResult
Returns:
A list of warnings or null.
See Also:
CompilationResult.getWarnings()

loadCompiledClass

public java.lang.Class<?> loadCompiledClass(java.lang.String className)
                                     throws java.lang.ClassNotFoundException
Description copied from interface: CompilationResult
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.

Specified by:
loadCompiledClass in interface CompilationResult
Returns:
The compiled class
Throws:
java.lang.ClassNotFoundException - If the class could not be found or compilation failed.
See Also:
CompilationResult.loadCompiledClass(java.lang.String)

didCompile

public boolean didCompile()
Description copied from interface: CompilationResult
Was a compilation required or were all classes recent?

Specified by:
didCompile in interface CompilationResult
Returns:
true>/code> if classes were compiled.
See Also:
CompilationResult.didCompile()

onError

public void onError(java.lang.String msg,
                    java.lang.String sourceFile,
                    int line,
                    int position)
Notification of an error


onWarning

public void onWarning(java.lang.String msg,
                      java.lang.String sourceFile,
                      int line,
                      int position)
Notification of a warning



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