Java 类com.google.protobuf.DescriptorProtos.ServiceDescriptorProto 实例源码

项目:reactive-grpc    文件:ReactiveGrpcGenerator.java   
private ServiceContext buildServiceContext(ServiceDescriptorProto serviceProto, ProtoTypeMap typeMap, List<Location> locations, int serviceNumber) {
    ServiceContext serviceContext = new ServiceContext();
    serviceContext.fileName = getClassPrefix() + serviceProto.getName() + "Grpc.java";
    serviceContext.className = getClassPrefix() + serviceProto.getName() + "Grpc";
    serviceContext.serviceName = serviceProto.getName();
    serviceContext.deprecated = serviceProto.getOptions() != null && serviceProto.getOptions().getDeprecated();

    locations.stream()
            .filter(location -> location.getPathCount() == METHOD_NUMBER_OF_PATHS &&
                    location.getPath(0) == FileDescriptorProto.SERVICE_FIELD_NUMBER &&
                    location.getPath(1) == serviceNumber &&
                    location.getPath(2) == ServiceDescriptorProto.METHOD_FIELD_NUMBER)
            .forEach(location -> {
                int methodNumber = location.getPath(METHOD_NUMBER_OF_PATHS - 1);
                MethodContext methodContext = buildMethodContext(serviceProto.getMethod(methodNumber), typeMap);
                methodContext.methodNumber = methodNumber;
                methodContext.javaDoc = getJavaDoc(getComments(location), getMethodJavaDocPrefix());
                serviceContext.methods.add(methodContext);
            });
    return serviceContext;
}
项目:play-store-api    文件:Descriptors.java   
private ServiceDescriptor(final ServiceDescriptorProto proto,
                          final FileDescriptor file,
                          final int index)
                   throws DescriptorValidationException {
  this.index = index;
  this.proto = proto;
  fullName = computeFullName(file, null, proto.getName());
  this.file = file;

  methods = new MethodDescriptor[proto.getMethodCount()];
  for (int i = 0; i < proto.getMethodCount(); i++) {
    methods[i] = new MethodDescriptor(
      proto.getMethod(i), file, this, i);
  }

  file.pool.addSymbol(this);
}
项目:sql-layer    文件:ProtobufDecompiler.java   
public void decompile(FileDescriptorProto fileDescriptor) throws IOException {
    if (fileDescriptor.hasPackage()) {
        indentedFormat("package %s;", fileDescriptor.getPackage());
        absolutePackage = "." + fileDescriptor.getPackage() + ".";
    }
    for (String dependency : fileDescriptor.getDependencyList()) {
        indentedFormat("import \"%s\";", dependency);
    }
    if (fileDescriptor.hasOptions()) {
        decompileOptions(fileDescriptor.getOptions());
    }
    decompileMembers(fileDescriptor.getEnumTypeList(),
                     fileDescriptor.getMessageTypeList(),
                     Collections.<FieldDescriptorProto>emptyList(),
                     Collections.<DescriptorProto.ExtensionRange>emptyList(),
                     fileDescriptor.getExtensionList());
    for (ServiceDescriptorProto serviceDescriptor : fileDescriptor.getServiceList()) {
        decompile(serviceDescriptor);
    }
    newline();
    flush();
}
项目:sql-layer    文件:ProtobufDecompiler.java   
protected void decompile(ServiceDescriptorProto serviceDescriptor) throws IOException {
    indentedFormat("service %s {", serviceDescriptor.getName());
    indent++;
    if (serviceDescriptor.hasOptions()) {
        decompileOptions(serviceDescriptor.getOptions());
    }
    for (MethodDescriptorProto methodDescriptor : serviceDescriptor.getMethodList()) {
        indentedFormat("rpc %s (%s) returns (%s)",
                       methodDescriptor.getName(), methodDescriptor.getInputType(), methodDescriptor.getOutputType());
        if (methodDescriptor.hasOptions()) {
            write("{ ");
            indent++;
            decompileOptions(methodDescriptor.getOptions());
            indent--;
            indentedFormat("}");
        }
        else {
            write(";");
        }
    }
    indent--;
    indentedFormat("}");
}
项目:armeria    文件:GrpcDocStringExtractor.java   
private static Optional<String> getFullName(FileDescriptorProto descriptor, List<Integer> path) {
    String fullNameSoFar = descriptor.getPackage();
    switch (path.get(0)) {
        case FileDescriptorProto.MESSAGE_TYPE_FIELD_NUMBER:
            DescriptorProto message = descriptor.getMessageType(path.get(1));
            return appendMessageToFullName(message, path, fullNameSoFar);
        case FileDescriptorProto.ENUM_TYPE_FIELD_NUMBER:
            EnumDescriptorProto enumDescriptor = descriptor.getEnumType(path.get(1));
            return Optional.of(appendEnumToFullName(enumDescriptor, path, fullNameSoFar));
        case FileDescriptorProto.SERVICE_FIELD_NUMBER:
            ServiceDescriptorProto serviceDescriptor = descriptor.getService(path.get(1));
            fullNameSoFar = appendNameComponent(fullNameSoFar, serviceDescriptor.getName());
            if (path.size() > 2) {
                fullNameSoFar = appendFieldComponent(
                        fullNameSoFar, serviceDescriptor.getMethod(path.get(3)).getName());
            }
            return Optional.of(fullNameSoFar);
        default:
            return Optional.empty();
    }
}
项目:Beam    文件:Descriptors.java   
private ServiceDescriptor (final ServiceDescriptorProto proto,
        final FileDescriptor file,
        final int index)
        throws DescriptorValidationException {
    this.index = index;
    this.proto = proto;
    fullName = computeFullName (file, null, proto.getName ());
    this.file = file;

    methods = new MethodDescriptor[proto.getMethodCount ()];
    for (int i = 0; i < proto.getMethodCount (); i++) {
        methods[i] = new MethodDescriptor (
                proto.getMethod (i), file, this, i);
    }

    file.pool.addSymbol (this);
}
项目:protobuf-el    文件:FileDescriptors.java   
private FileDescriptorProto makeCanonicalProto(final FileDescriptor fileDescriptor) {
  final FileDescriptorProto.Builder protoBuilder =
      FileDescriptorProto.newBuilder(fileDescriptor.toProto());

  for (final FieldDescriptorProto.Builder field : protoBuilder.getExtensionBuilderList()) {
    makeCanonicalField(field, fileDescriptor.findExtensionByName(field.getName()));
  }

  for (final DescriptorProto.Builder message : protoBuilder.getMessageTypeBuilderList()) {
    makeCanonicalMessage(message, fileDescriptor.findMessageTypeByName(message.getName()));
  }

  // for (EnumDescriptorProto.Builder enumProto :
  // protoBuilder.getEnumTypeBuilderList()) {
  // makeCanonicalEnum(enumProto,
  // fileDescriptor.findEnumTypeByName(enumProto.getName()));
  // }

  for (final ServiceDescriptorProto.Builder serviceProto : protoBuilder.getServiceBuilderList()) {
    makeCanonicalService(serviceProto, fileDescriptor.findServiceByName(serviceProto.getName()));
  }

  // TODO: incorporate options' tree walking into canonicalization to eliminate double walking
  return OptionResolver.newBuilder().setCustomOptionsAsExtensions(false)
      .resolveAllOptionsFor(fileDescriptor, protoBuilder).build();
}
项目:protobuf-el    文件:OptionResolver.java   
private void buildAllOptions(final FileDescriptorProto.Builder proto) {
  if (!buildOptions(proto.getOptionsBuilder())) {
    proto.clearOptions();
  }

  for (final FieldDescriptorProto.Builder extensionProto : proto.getExtensionBuilderList()) {
    if (!buildOptions(extensionProto.getOptionsBuilder())) {
      extensionProto.clearOptions();
    }
  }

  for (final EnumDescriptorProto.Builder enumProto : proto.getEnumTypeBuilderList()) {
    buildAllOptions(enumProto);
  }

  for (final ServiceDescriptorProto.Builder serviceProto : proto.getServiceBuilderList()) {
    buildAllOptions(serviceProto);
  }

  for (final DescriptorProto.Builder messageProto : proto.getMessageTypeBuilderList()) {
    buildAllOptions(messageProto);
  }
}
项目:protobuf-el    文件:FileDescriptorEx.java   
private FileDescriptorProto makeCanonicalProto(final FileDescriptor file) {
  final FileDescriptorProto.Builder protoBuilder = FileDescriptorProto.newBuilder(file.toProto());

  for (final FieldDescriptorProto.Builder field : protoBuilder.getExtensionBuilderList()) {
    makeCanonicalField(field, file.findExtensionByName(field.getName()));
  }

  for (final DescriptorProto.Builder message : protoBuilder.getMessageTypeBuilderList()) {
    makeCanonicalMessage(message, file.findMessageTypeByName(message.getName()));
  }

  // for (EnumDescriptorProto.Builder enumProto :
  // protoBuilder.getEnumTypeBuilderList()) {
  // makeCanonicalEnum(enumProto,
  // file.findEnumTypeByName(enumProto.getName()));
  // }

  for (final ServiceDescriptorProto.Builder serviceProto : protoBuilder.getServiceBuilderList()) {
    makeCanonicalService(serviceProto, file.findServiceByName(serviceProto.getName()));
  }

  return OptionResolver.newBuilder().setCustomOptionsAsExtensions(reparseCustomOptions)
      .resolveAllOptionsFor(file, protoBuilder).build();
}
项目:closure-templates    文件:JavaQualifiedNames.java   
/** Checks whether any generated classes conflict with the given name. */
private static boolean hasConflictingClassName(FileDescriptorProto file, String name) {
  for (EnumDescriptorProto enumDesc : file.getEnumTypeList()) {
    if (name.equals(enumDesc.getName())) {
      return true;
    }
  }
  for (ServiceDescriptorProto serviceDesc : file.getServiceList()) {
    if (name.equals(serviceDesc.getName())) {
      return true;
    }
  }
  for (DescriptorProto messageDesc : file.getMessageTypeList()) {
    if (hasConflictingClassName(messageDesc, name)) {
      return true;
    }
  }
  return false;
}
项目:piezo    文件:ProtoFileHandler.java   
public void handle(FileDescriptorProto protoFile) throws IOException {
  String javaPackage = inferJavaPackage(protoFile);
  boolean multipleFiles = protoFile.getOptions().getJavaMultipleFiles();
  String outerClassName = null;
  if (!multipleFiles) {
    if (protoFile.getOptions().hasJavaOuterClassname()) {
      outerClassName = protoFile.getOptions().getJavaOuterClassname();
    } else {
      outerClassName = inferOuterClassName(protoFile);
    }
  }
  ProtoServiceHandler serviceHandler = new ProtoServiceHandler(javaPackage, types,
      multipleFiles, outerClassName, protoFile.getPackage(), output);
  for (ServiceDescriptorProto service : protoFile.getServiceList()) {
    serviceHandler.handle(service);
  }
}
项目:saluki    文件:CommonProto2Java.java   
private void doPrint(FileDescriptorProto fdp, String javaPackage, String outerClassName) {
  List<DescriptorProto> messageDescList = Lists.newArrayList(fdp.getMessageTypeList());
  List<ServiceDescriptorProto> serviceDescList = Lists.newArrayList(fdp.getServiceList());
  List<EnumDescriptorProto> enumDescList = Lists.newArrayList(fdp.getEnumTypeList());
  messageDescList.stream().filter(temp -> temp.getEnumTypeList() != null)
      .forEach(temp -> enumDescList.addAll(temp.getEnumTypeList()));
  printEnum(enumDescList, javaPackage, outerClassName);
  printMessage(messageDescList, javaPackage, outerClassName);
  printService(serviceDescList, javaPackage);
}
项目:saluki    文件:CommonProto2Java.java   
private void printService(List<ServiceDescriptorProto> serviceDescList, String javaPackage) {
  for (ServiceDescriptorProto serviceDesc : serviceDescList) {
    PrintServiceFile serviceFile =
        new PrintServiceFile(generatePath, javaPackage, serviceDesc.getName());
    try {
      serviceFile.setServiceMethods(serviceDesc.getMethodList());
      serviceFile.setPojoTypeCache(pojoTypes);
    } finally {
      serviceFile.print();
    }
  }
}
项目:api-compiler    文件:DescriptorGenerator.java   
private ServiceDescriptorProto generateApi(Api api) {
  ServiceDescriptorProto.Builder builder = ServiceDescriptorProto.newBuilder();
  builder.setName(getSimpleName(api.getName()));
  for (Method method : api.getMethodsList()) {
    builder.addMethod(generateMethod(method));
  }
  if (!api.getOptionsList().isEmpty()) {
    builder.setOptions(generateServiceOptions(api));
  }
  return builder.build();
}
项目:api-compiler    文件:Interface.java   
private Interface(ProtoFile parent, ServiceDescriptorProto proto, String path) {
  super(parent, proto.getName(), path);
  this.proto = proto;

  // Build methods.
  ImmutableList.Builder<Method> methodsBuilder = ImmutableList.builder();
  List<MethodDescriptorProto> methodProtos = proto.getMethodList();
  for (int i = 0; i < methodProtos.size(); i++) {
    String childPath = buildPath(path, ServiceDescriptorProto.METHOD_FIELD_NUMBER, i);
    methodsBuilder.add(Method.create(this, methodProtos.get(i), childPath));
  }

  methods = methodsBuilder.build();
}
项目:api-compiler    文件:BuilderVisitor.java   
@Accepts
protected void accept(ServiceDescriptorProto.Builder service) {
  pushParent(BuilderVisitorNodeInfo.create(service, currentFile));
  visitRepeated(ServiceDescriptorProto.METHOD_FIELD_NUMBER);
  visit(service.getOptionsBuilder());
  popExpectedParent(service);
}
项目:play-store-api    文件:Descriptors.java   
/** See {@link FileDescriptor#setProto}. */
private void setProto(final ServiceDescriptorProto proto) {
  this.proto = proto;

  for (int i = 0; i < methods.length; i++) {
    methods[i].setProto(proto.getMethod(i));
  }
}
项目:Beam    文件:Descriptors.java   
/**
 * See {@link FileDescriptor#setProto}.
 */
private void setProto (final ServiceDescriptorProto proto) {
    this.proto = proto;

    for (int i = 0; i < methods.length; i++) {
        methods[i].setProto (proto.getMethod (i));
    }
}
项目:protobuf-el    文件:FileDescriptors.java   
private void makeCanonicalService(final ServiceDescriptorProto.Builder service,
    final ServiceDescriptor serviceDescriptor) {
  for (final MethodDescriptorProto.Builder method : service.getMethodBuilderList()) {
    final MethodDescriptor methodDescriptor =
        serviceDescriptor.findMethodByName(method.getName());
    method.setInputType(ensureLeadingDot(methodDescriptor.getInputType().getFullName()));
    method.setOutputType(ensureLeadingDot(methodDescriptor.getOutputType().getFullName()));
  }
}
项目:protobuf-el    文件:ProtoFileParser.java   
@Override
public void exitService(final ServiceContext ctx) {
  final ServiceDescriptorProto.Builder serviceBuilder =
      ServiceDescriptorProto.Builder.class.cast(scopes.getProtoBuilder());
  serviceBuilder.setName(ctx.identifier().getText());
  scopes.popScope();
}
项目:protobuf-el    文件:OptionResolver.java   
private void buildAllOptions(final ServiceDescriptorProto.Builder proto) {
  if (!buildOptions(proto.getOptionsBuilder())) {
    proto.clearOptions();
  }

  for (final MethodDescriptorProto.Builder methodProto : proto.getMethodBuilderList()) {
    if (!buildOptions(methodProto.getOptionsBuilder())) {
      methodProto.clearOptions();
    }
  }
}
项目:protobuf-el    文件:FileDescriptorEx.java   
private boolean isCanonical(final FileDescriptor file) {
  final FileDescriptorProto proto = file.toProto();

  if (proto.hasOptions() && proto.getOptions().getUninterpretedOptionCount() > 0) {
    return false;
  }

  for (final FieldDescriptorProto field : proto.getExtensionList()) {
    if (!isFieldCanonical(field)) {
      return false;
    }
  }

  for (final ServiceDescriptorProto serviceProto : proto.getServiceList()) {
    if (!isCanonical(serviceProto)) {
      return false;
    }
  }

  for (final EnumDescriptorProto enumProto : proto.getEnumTypeList()) {
    if (!isCanonical(enumProto)) {
      return false;
    }
  }

  for (final DescriptorProto message : proto.getMessageTypeList()) {
    if (!isMessageRefsCanonical(message)) {
      return false;
    }
  }

  return true;
}
项目:protobuf-el    文件:FileDescriptorEx.java   
private boolean isCanonical(final ServiceDescriptorProto serviceProto) {
  if (serviceProto.hasOptions() && serviceProto.getOptions().getUninterpretedOptionCount() > 0) {
    return false;
  }

  for (final MethodDescriptorProto methodProto : serviceProto.getMethodList()) {
    if (methodProto.hasOptions() && methodProto.getOptions().getUninterpretedOptionCount() > 0) {
      return false;
    }
  }

  return true;
}
项目:protobuf-el    文件:FileDescriptorEx.java   
private void makeCanonicalService(final ServiceDescriptorProto.Builder service,
    final ServiceDescriptor serviceDescriptor) {
  for (final MethodDescriptorProto.Builder method : service.getMethodBuilderList()) {
    final MethodDescriptor methodDescriptor =
        serviceDescriptor.findMethodByName(method.getName());
    method.setInputType(ensureLeadingDot(methodDescriptor.getInputType().getFullName()));
    method.setOutputType(ensureLeadingDot(methodDescriptor.getOutputType().getFullName()));
  }
}
项目:protobuf-el    文件:DescriptorFactory.java   
private FileDescriptorProto createFileDescriptorProto(String fileName, String packageName, 
    UnknownFieldSet unknownFields) { 
  FileDescriptorProto.Builder fileBuilder = FileDescriptorProto.newBuilder();
  return fileBuilder
      .setName(fileName)
      .setPackage(packageName)
      .setUnknownFields(unknownFields)
      .addAllDependency(Collections.<String>emptyList())
      .addAllEnumType(Collections.<EnumDescriptorProto>emptyList())
      .addAllExtension(Collections.<FieldDescriptorProto>emptyList())
      .addAllMessageType(Collections.<DescriptorProto>emptyList())
      .addAllPublicDependency(Collections.<Integer>emptyList())
      .addAllService(Collections.<ServiceDescriptorProto>emptyList())
      .build();
}
项目:piezo    文件:ProtoServiceHandler.java   
public void handle(ServiceDescriptorProto service) throws IOException {
  ImmutableList.Builder<ServiceHandlerData.Method> methods = ImmutableList.builder();
  for (MethodDescriptorProto method : service.getMethodList()) {
    ServiceHandlerData.Method methodData = new ServiceHandlerData.Method(
        method.getName(),
        CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, method.getName()),
        types.lookup(method.getInputType()).toString(),
        types.lookup(method.getOutputType()).toString());
    methods.add(methodData);
  }

  String fullName = Joiner.on('.').skipNulls().join(protoPackage, service.getName());

  ServiceHandlerData.Service serviceData = new ServiceHandlerData.Service(
      service.getName(), fullName, methods.build());
  ServiceHandlerData data = new ServiceHandlerData(javaPackage, multipleFiles, serviceData);

  String template = Resources.toString(Resources.getResource(this.getClass(),
      "service_class.mvel"), Charsets.UTF_8);
  String serviceFile = (String) TemplateRuntime.eval(template,
      ImmutableMap.<String, Object>of("handler", data));

  CodeGeneratorResponse.Builder response = CodeGeneratorResponse.newBuilder();
  CodeGeneratorResponse.File.Builder file = CodeGeneratorResponse.File.newBuilder();
  file.setContent(serviceFile);
  file.setName(javaPackage.replace('.', '/') + '/' + service.getName() + ".java");
  if (!multipleFiles) {
    file.setName(javaPackage.replace('.', '/') + '/' + outerClassName + ".java");
    file.setInsertionPoint("outer_class_scope");
  }
  response.addFile(file);
  response.build().writeTo(output);
}
项目:api-compiler    文件:DescriptorNormalization.java   
public static List<Option> getOptions(ServiceDescriptorProto descriptor) {
  return getOptions(descriptor, true);
}
项目:api-compiler    文件:DescriptorNormalization.java   
public static List<Option> getOptions(ServiceDescriptorProto descriptor, boolean withDefaults) {
  return toCoreOptions(maybeCombineOptionsWithDefault(withDefaults,
      descriptor.getOptions().getAllFields(), DEFAULT_SERVICE_OPTIONS));
}
项目:api-compiler    文件:Interface.java   
/**
 * Creates a interface backed up by the given proto.
 */
public static Interface create(ProtoFile parent, ServiceDescriptorProto proto, String path) {
  return new Interface(parent, proto, path);
}
项目:api-compiler    文件:Interface.java   
/**
 * Returns the underlying proto representation.
 */
public ServiceDescriptorProto getProto() {
  return proto;
}
项目:api-compiler    文件:RestAnalyzerTest.java   
private void restify(MethodKind httpKind, String simpleName, String template) {
  Model model = Model.create(FileDescriptorSet.getDefaultInstance());

  model.setServiceConfig(
      ConfigSource.newBuilder(Service.getDefaultInstance())
          .setValue(
              Service.getDescriptor().findFieldByNumber(Service.CONFIG_VERSION_FIELD_NUMBER),
              null,
              UInt32Value.newBuilder().setValue(configVersion).build(),
              new SimpleLocation("from test"))
          .build());
  HttpConfigAspect aspect = HttpConfigAspect.create(model);
  ProtoFile file =
      ProtoFile.create(
          model, FileDescriptorProto.getDefaultInstance(), true, ExtensionPool.EMPTY);
  Interface iface = Interface.create(file, ServiceDescriptorProto.getDefaultInstance(), "");
  Method method =
      Method.create(iface, MethodDescriptorProto.newBuilder().setName(simpleName).build(), "");

  RestMethod restMethod;
  ImmutableList<PathSegment> path = parse(model, template);
  if (!model.getDiagReporter().getDiagCollector().getDiags().isEmpty()) {
    restMethod = RestMethod.create(method, RestKind.CUSTOM, "*error*", "*error*", null);
  } else {
    HttpRule httpRule = HttpRule.getDefaultInstance();
    HttpAttribute httpConfig =
        new HttpAttribute(
            httpRule,
            httpKind,
            MessageType.create(file, Empty.getDescriptor().toProto(), "", ExtensionPool.EMPTY),
            path,
            "",
            false,
            ImmutableList.<HttpAttribute>of(),
            false);
    RestAnalyzer analyzer = new RestAnalyzer(aspect);
    restMethod = analyzer.analyzeMethod(method, httpConfig);
  }

  PrintWriter pw = testOutput();
  pw.print(httpKind.toString());
  pw.print(" ");
  pw.print(simpleName);
  pw.print(" ");
  pw.print(template.isEmpty() ? "(empty)" : template);
  pw.println();
  pw.println(Strings.repeat("=", 70));
  pw.printf("Rest Kind:   %s\n", restMethod.getRestKind());
  pw.printf(
      "Version:  %s\n", restMethod.getVersion().isEmpty() ? "(empty)" : restMethod.getVersion());
  pw.printf(
      "Version with default:  %s\n",
      restMethod.getVersionWithDefault().isEmpty()
          ? "(empty)"
          : restMethod.getVersionWithDefault());
  pw.printf(
      "Simple collection:  %s\n",
      restMethod.getRestCollectionName().isEmpty()
          ? "(empty)"
          : restMethod.getSimpleRestCollectionName());
  pw.printf(
      "Versioned collection:  %s\n",
      restMethod.getRestCollectionName().isEmpty()
      ? "(empty)" : restMethod.getRestCollectionName());
   pw.printf("Base collection:  %s\n",
      restMethod.getBaseRestCollectionName().isEmpty()
      ? "(empty)" : restMethod.getBaseRestCollectionName());
  pw.printf("Custom Name: %s\n",
      restMethod.getRestKind() == RestKind.CUSTOM
      ? restMethod.getRestMethodName() : "(null)");

  List<Diag> diags = model.getDiagReporter().getDiagCollector().getDiags();
  if (diags.size() > 0) {
    pw.println("Diagnostics:");
    for (Diag d : diags) {
      pw.printf("  %s\n", DiagUtils.getDiagToPrint(d, true));
    }
  }
  pw.println();
}
项目:play-store-api    文件:Descriptors.java   
/** Convert the descriptor to its protocol message representation. */
@Override
public ServiceDescriptorProto toProto() {
  return proto;
}
项目:Beam    文件:Descriptors.java   
/**
 * Convert the descriptor to its protocol message representation.
 */
public ServiceDescriptorProto toProto () {
    return proto;
}
项目:protobuf-el    文件:Scopes.java   
public ServiceDescriptorProto.Builder addService() {
  final ServiceDescriptorProto.Builder builder = currentScope.addService();
  pushScope(new ServiceScope(builder, currentScope));
  return builder;
}
项目:protobuf-el    文件:Scopes.java   
protected ServiceDescriptorProto.Builder addService() {
  throw new RuntimeException(NOT_APPLICABLE_IN_CURRENT_SCOPE);
}
项目:protobuf-el    文件:Scopes.java   
@Override
protected ServiceDescriptorProto.Builder addService() {
  return protoBuilder.addServiceBuilder();
}
项目:protobuf-el    文件:Scopes.java   
private ServiceScope(final ServiceDescriptorProto.Builder protoBuilder, final Scope<?> parent) {
  super(protoBuilder, parent);
}
项目:protobuf-el    文件:AbstractMessageUtils.java   
public static boolean compareProto(final ServiceDescriptorProto me, final @Nullable Object other) {
  return compareMessage(me, other, new ProtoFilter());
}