SOURCETYPE source = buildJavaSource(javaSourceFacet);
JavaResource javaResource;
if (source.hasSyntaxErrors())
{
UIOutput output = uiContext.getProvider().getOutput();
PrintStream err = output.err();
err.println("Syntax Errors:");
for (SyntaxError error : source.getSyntaxErrors())
{
err.println(error);
}