com.salesforce.jprotoc.GeneratorException Java Examples
The following examples show how to use
com.salesforce.jprotoc.GeneratorException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MutinyGrpcGenerator.java From quarkus with Apache License 2.0 | 5 votes |
@Override public List<PluginProtos.CodeGeneratorResponse.File> generateFiles(PluginProtos.CodeGeneratorRequest request) throws GeneratorException { ProtoTypeMap typeMap = ProtoTypeMap.of(request.getProtoFileList()); List<DescriptorProtos.FileDescriptorProto> protosToGenerate = request.getProtoFileList().stream() .filter(protoFile -> request.getFileToGenerateList().contains(protoFile.getName())) .collect(Collectors.toList()); List<ServiceContext> services = findServices(protosToGenerate, typeMap); return generateFiles(services); }
Example #2
Source File: AbstractGenerator.java From sofa-rpc with Apache License 2.0 | 5 votes |
@Override public List<PluginProtos.CodeGeneratorResponse.File> generateFiles(PluginProtos.CodeGeneratorRequest request) throws GeneratorException { final ProtoTypeMap typeMap = ProtoTypeMap.of(request.getProtoFileList()); List<FileDescriptorProto> protosToGenerate = new ArrayList<>(); for (FileDescriptorProto protoFile : request.getProtoFileList()) { if (request.getFileToGenerateList().contains(protoFile.getName())) { protosToGenerate.add(protoFile); } } List<ServiceContext> services = findServices(protosToGenerate, typeMap); return generateFiles(services); }
Example #3
Source File: ReactiveGrpcGenerator.java From reactive-grpc with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public List<PluginProtos.CodeGeneratorResponse.File> generateFiles(PluginProtos.CodeGeneratorRequest request) throws GeneratorException { final ProtoTypeMap typeMap = ProtoTypeMap.of(request.getProtoFileList()); List<FileDescriptorProto> protosToGenerate = request.getProtoFileList().stream() .filter(protoFile -> request.getFileToGenerateList().contains(protoFile.getName())) .collect(Collectors.toList()); List<ServiceContext> services = findServices(protosToGenerate, typeMap); return generateFiles(services); }
Example #4
Source File: DumpGenerator.java From grpc-java-contrib with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public List<PluginProtos.CodeGeneratorResponse.File> generateFiles(PluginProtos.CodeGeneratorRequest request) throws GeneratorException { try { return Arrays.asList( makeFile("descriptor_dump", request.toByteArray()), makeFile("descriptor_dump.json", JsonFormat.printer().print(request)) ); } catch (InvalidProtocolBufferException e) { throw new GeneratorException(e.getMessage()); } }
Example #5
Source File: Jdk8Generator.java From grpc-java-contrib with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public List<PluginProtos.CodeGeneratorResponse.File> generateFiles(PluginProtos.CodeGeneratorRequest request) throws GeneratorException { final ProtoTypeMap protoTypeMap = ProtoTypeMap.of(request.getProtoFileList()); List<PluginProtos.CodeGeneratorResponse.File> files = new ArrayList<>(); for (DescriptorProtos.FileDescriptorProto protoFile : request.getProtoFileList()) { if (request.getFileToGenerateList().contains(protoFile.getName())) { for (ServiceContext ctx : extractContext(protoTypeMap, protoFile)) { files.add(buildFile(ctx)); } } } return files; }