Browse files

added/fixed documentation

  • Loading branch information...
1 parent 6a70bc8 commit d2ad57f0da07dcb69367c9b53f55bdbe9f1e9452 @mirkoseifert mirkoseifert committed Apr 4, 2013
View
17 ...FlyJavac/de.devboost.onthefly_javac/src/de/devboost/onthefly_javac/CompilationResult.java
@@ -23,11 +23,18 @@
import de.devboost.onthefly_javac.internal.ByteArrayJavaFileObject;
+/**
+ * Instances of this class encapsulate the result of an in-memory compilation.
+ * More specifically, the byte code of all compiled classes is held by this
+ * class. Also, the status (e.g., success or failure) of the compilation process
+ * can be obtained from this class.
+ */
public class CompilationResult {
private Map<String, ByteArrayJavaFileObject> store = new LinkedHashMap<String, ByteArrayJavaFileObject>();
private DiagnosticCollector<JavaFileObject> diagnosticsCollector = new DiagnosticCollector<JavaFileObject>();
+
private boolean success;
protected Map<String, ByteArrayJavaFileObject> getStore() {
@@ -50,6 +57,9 @@ public boolean isSuccess() {
return diagnosticsCollector;
}
+ /**
+ * Returns the byte code for the class with the given qualified name.
+ */
public byte[] getByteCode(String className) {
ByteArrayJavaFileObject file = getFileByName(className);
if (file == null) {
@@ -58,9 +68,12 @@ public boolean isSuccess() {
return file.getByteArray();
}
+ /**
+ * Loads the class with the given qualified name.
+ */
public Class<?> loadClass(String className) throws ClassNotFoundException {
- // we do use 'null' as parent class loaded to avoid the classes are
- // loaded using the system class loader. this ensure that we load only
+ // we do use 'null' as parent class loaded to avoid that classes are
+ // loaded using the system class loader. this ensures that we load only
// classes which were explicitly compiled in memory.
ClassLoader _classLoader = new ClassLoader(null) {

0 comments on commit d2ad57f

Please sign in to comment.