/** * Returns Google's protobuf descriptor, which defines standard options like default, deprecated, * and java_package. If the user has provided their own version of the descriptor proto, that is * preferred. */ private ProtoFile loadDescriptorProto() throws IOException { InputStream resourceAsStream = SchemaLoader.class.getResourceAsStream("/" + DESCRIPTOR_PROTO); try (BufferedSource buffer = Okio.buffer(Okio.source(resourceAsStream))) { String data = buffer.readUtf8(); Location location = Location.get("", DESCRIPTOR_PROTO); ProtoFileElement element = ProtoParser.parse(location, data); return ProtoFile.get(element); } }
ProtoFile protoFile = ProtoFile.get(element); loaded.put(proto, protoFile);
.options(ImmutableList.of(option1, option2)) .build(); ProtoFile file = ProtoFile.get(fileElement);
/** * Returns Google's protobuf descriptor, which defines standard options like default, deprecated, * and java_package. If the user has provided their own version of the descriptor proto, that is * preferred. */ private ProtoFile loadDescriptorProto() throws IOException { InputStream resourceAsStream = SchemaLoader.class.getResourceAsStream("/" + DESCRIPTOR_PROTO); try (BufferedSource buffer = Okio.buffer(Okio.source(resourceAsStream))) { String data = buffer.readUtf8(); Location location = Location.get("", DESCRIPTOR_PROTO); ProtoFileElement element = ProtoParser.parse(location, data); return ProtoFile.get(element); } }
/** * Returns Google's protobuf descriptor, which defines standard options like default, deprecated, * and java_package. If the user has provided their own version of the descriptor proto, that is * preferred. */ private ProtoFile loadDescriptorProto() throws IOException { InputStream resourceAsStream = SchemaLoader.class.getResourceAsStream("/" + DESCRIPTOR_PROTO); try (BufferedSource buffer = Okio.buffer(Okio.source(resourceAsStream))) { String data = buffer.readUtf8(); Location location = Location.get("", DESCRIPTOR_PROTO); ProtoFileElement element = ProtoParser.parse(location, data); return ProtoFile.get(element); } }
ProtoFile protoFile = ProtoFile.get(element); loaded.put(proto, protoFile);
ProtoFile protoFile = ProtoFile.get(element); loaded.put(proto, protoFile);