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

com.softicar.platform.common.code.java.compiler.RuntimeCompilerDiagnostic Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.code.java.compiler;

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

public class RuntimeCompilerDiagnostic {

	private final Diagnostic diagnostic;

	public RuntimeCompilerDiagnostic(Diagnostic diagnostic) {

		this.diagnostic = diagnostic;
	}

	@Override
	public String toString() {

		if (diagnostic != null) {
			JavaFileObject source = diagnostic.getSource();
			return String.format("Error in %s:%s: %s", source != null? source.getName() : "unknown", diagnostic.getLineNumber(), diagnostic.getMessage(null));
		} else {
			return String.format("Error: cannot show diagnostic message because diagnostic object is null");
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy