use of io.protostuff.compiler.model.Service in project java-chassis by ServiceComb.
the class ProtoToStringGenerator method protoToString.
public String protoToString() {
StringBuilder sb = new StringBuilder();
appendLine(sb, "syntax = \"%s\";", proto.getSyntax());
for (Import importValue : proto.getImports()) {
appendLine(sb, "import \"%s\";", importValue.getValue());
}
appendLine(sb, "package %s;\n", proto.getPackage().getValue());
for (Message message : proto.getMessages()) {
messageToString(message, sb);
}
for (Enum enumValue : proto.getEnums()) {
enumToString(enumValue, sb);
}
for (Service service : proto.getServices()) {
serviceToString(service, sb);
}
return sb.toString();
}
use of io.protostuff.compiler.model.Service in project incubator-servicecomb-java-chassis by apache.
the class ProtoToStringGenerator method protoToString.
public String protoToString() {
StringBuilder sb = new StringBuilder();
appendLine(sb, "syntax = \"%s\";", proto.getSyntax());
for (Import importValue : proto.getImports()) {
appendLine(sb, "import \"%s\";", importValue.getValue());
}
appendLine(sb, "package %s;\n", proto.getPackage().getValue());
for (Message message : proto.getMessages()) {
messageToString(message, sb);
}
for (Enum enumValue : proto.getEnums()) {
enumToString(enumValue, sb);
}
for (Service service : proto.getServices()) {
serviceToString(service, sb);
}
return sb.toString();
}
use of io.protostuff.compiler.model.Service 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.Service 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.Service 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