salesforce/grpc-java-contrib

Expose getJavaOuterClassname in JProtoc

Fadelis opened this issue · 0 comments

When extending base generated java classes you need to provide the file path to the actual .java file and determining it involves a bit of logic that you've already implemented. So to make it easier to develop protoc extension plugins I'd suggest to expose this method:

Current workaround I've implemented is to extract the filename from the JavaType provided in this map:
https://github.com/Fadelis/protoc-gen-java-optional/blob/055440fe6ca14dfeb8ba96413880dd3f45e82fd8/protoc-gen-java-optional/src/main/java/org/grpcmock/protoc/plugin/OptionalGenerator.java#L210-L215