use of io.protostuff.compiler.model.ServiceMethod in project java-chassis by ServiceComb.
the class ProtoToStringGenerator method serviceToString.
private void serviceToString(Service service, StringBuilder sb) {
appendLine(sb, "service %s {", service.getName());
for (ServiceMethod serviceMethod : service.getMethods()) {
commentsToString(serviceMethod.getCommentLines(), sb, 2);
appendLine(sb, " rpc %s (%s) returns (%s);\n", serviceMethod.getName(), serviceMethod.getArgTypeName(), serviceMethod.getReturnTypeName());
}
if (!service.getMethods().isEmpty()) {
sb.setLength(sb.length() - 1);
}
appendLine(sb, "}");
}
use of io.protostuff.compiler.model.ServiceMethod in project java-chassis by ServiceComb.
the class ProtoMapper method getResponseMessage.
public Message getResponseMessage(String operationId) {
Service service = proto.getServices().get(0);
ServiceMethod serviceMethod = service.getMethod(operationId);
return serviceMethod.getReturnType();
}
use of io.protostuff.compiler.model.ServiceMethod in project java-chassis by ServiceComb.
the class ProtoMapper method getRequestMessage.
public Message getRequestMessage(String operationId) {
Service service = proto.getServices().get(0);
ServiceMethod serviceMethod = service.getMethod(operationId);
if (serviceMethod == null) {
throw new IllegalArgumentException("operation not found, operation id=" + operationId);
}
return serviceMethod.getArgType();
}
use of io.protostuff.compiler.model.ServiceMethod in project incubator-servicecomb-java-chassis by apache.
the class ProtoToStringGenerator method serviceToString.
private void serviceToString(Service service, StringBuilder sb) {
appendLine(sb, "service %s {", service.getName());
for (ServiceMethod serviceMethod : service.getMethods()) {
commentsToString(serviceMethod.getCommentLines(), sb, 2);
appendLine(sb, " rpc %s (%s) returns (%s);\n", serviceMethod.getName(), serviceMethod.getArgTypeName(), serviceMethod.getReturnTypeName());
}
if (!service.getMethods().isEmpty()) {
sb.setLength(sb.length() - 1);
}
appendLine(sb, "}");
}
use of io.protostuff.compiler.model.ServiceMethod in project incubator-servicecomb-java-chassis by apache.
the class ProtoMapper method getRequestMessage.
public Message getRequestMessage(String operationId) {
Service service = proto.getServices().get(0);
ServiceMethod serviceMethod = service.getMethod(operationId);
if (serviceMethod == null) {
throw new IllegalArgumentException("operation not found, operation id=" + operationId);
}
return serviceMethod.getArgType();
}
Aggregations