All Downloads are FREE. Search and download functionalities are using the official Maven repository.

framework.src.org.checkerframework.framework.test.CompilationResult Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java’s type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.42.0
Show newest version
package org.checkerframework.framework.test;

import java.util.Collections;
import java.util.List;

import javax.tools.Diagnostic;
import javax.tools.JavaFileObject;

/**
 * CompilationResult represents the output of the compiler after it is run.
 */
public class CompilationResult {
    private final boolean compiledWithoutError;
    private final String javacOutput;
    private final Iterable javaFileObjects;
    private final List> diagnostics;

    CompilationResult(boolean compiledWithoutError, String javacOutput,
                      Iterable javaFileObjects,
                      List> diagnostics) {
        this.compiledWithoutError = compiledWithoutError;
        this.javacOutput = javacOutput;
        this.javaFileObjects = javaFileObjects;
        this.diagnostics = Collections.unmodifiableList(diagnostics);
    }

    /**
     * @return whether or not compilation succeeded without errors or exceptions
     */
    public boolean compiledWithoutError() {
        return compiledWithoutError;
    }

    /**
     * @return all of the output from the compiler
     */
    public String getJavacOutput() {
        return javacOutput;
    }

    /**
     * @return the list of Java files passed to the compiler
     */
    public Iterable getJavaFileObjects() {
        return javaFileObjects;
    }

    /**
     * @return the diagnostics reported by the compiler
     */
    public List> getDiagnostics() {
        return diagnostics;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy