Search in sources :

Example 1 with ErrorInfo

use of com.yahoo.squidb.processor.data.ErrorInfo in project squidb by yahoo.

the class ErrorLoggingPlugin method emitAdditionalJava.

@Override
public void emitAdditionalJava(JavaFileWriter writer) throws IOException {
    List<ErrorInfo> errors = modelSpec.getLoggedErrors();
    if (errors.size() > 0) {
        writer.writeExpression(new ModelGenErrorsExpression(errors)).writeNewline();
        TypeDeclarationParameters dummyErrorClass = new TypeDeclarationParameters().setModifiers(Modifier.STATIC, Modifier.FINAL).setName(new DeclaredTypeName(modelSpec.getGeneratedClassName().toString(), "LoggedErrors")).setKind(JavaFileWriter.Type.CLASS);
        writer.beginTypeDefinition(dummyErrorClass);
        writer.writeComment("Dummy class for holding logged error annotations");
        writer.finishTypeDefinition();
    }
}
Also used : DeclaredTypeName(com.yahoo.aptutils.model.DeclaredTypeName) TypeDeclarationParameters(com.yahoo.aptutils.writer.parameters.TypeDeclarationParameters) ErrorInfo(com.yahoo.squidb.processor.data.ErrorInfo)

Aggregations

DeclaredTypeName (com.yahoo.aptutils.model.DeclaredTypeName)1 TypeDeclarationParameters (com.yahoo.aptutils.writer.parameters.TypeDeclarationParameters)1 ErrorInfo (com.yahoo.squidb.processor.data.ErrorInfo)1