use of com.yahoo.aptutils.model.DeclaredTypeName 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();
}
}
use of com.yahoo.aptutils.model.DeclaredTypeName in project squidb by yahoo.
the class JSONPropertyGenerator method getPropertyType.
@Override
public DeclaredTypeName getPropertyType() {
DeclaredTypeName jsonProperty = JSONTypes.JSON_PROPERTY.clone();
jsonProperty.setTypeArgs(Collections.singletonList(fieldType));
return jsonProperty;
}
Aggregations