public ObjectNode toJson(ObjectMapper OBJECT_MAPPER) { ObjectNode result = OBJECT_MAPPER.createObjectNode(); ArrayNode servicesJson = OBJECT_MAPPER.createArrayNode(); result.set("services", servicesJson); for (SService sService : servicesByName.values()) { ObjectNode serviceJson = OBJECT_MAPPER.createObjectNode(); serviceJson.put("name", sService.getName()); serviceJson.put("simpleName", sService.getSimpleName()); servicesJson.add(serviceJson); ArrayNode methodsJson = OBJECT_MAPPER.createArrayNode(); serviceJson.set("methods", methodsJson); for (SMethod method : sService.getMethods()) { methodsJson.add(method.toJson(OBJECT_MAPPER)); } } return result; }
@Override public List<SServiceMethod> getServiceMethods(String serviceInterfaceName) throws ServerException, UserException { List<SServiceMethod> sServiceMethods = new ArrayList<SServiceMethod>(); SService sService = getBimServer().getServicesMap().getByName(serviceInterfaceName); if (sService == null) { throw new UserException("Service \"" + serviceInterfaceName + "\" not found"); } for (SMethod sMethod : sService.getMethods()) { SServiceMethod sServiceMethod = convertMethod(sMethod); sServiceMethods.add(sServiceMethod); } return sServiceMethods; }
methodBuilder.append("{"); methodBuilder.append("if (1==0) {} "); for (SMethod sMethod : sService.getMethods()) { methodBuilder.append(" else if ($2.equals(\"" + sMethod.getName() + "\")) {"); if (!sMethod.getReturnType().isVoid()) {
generateVoidMessage(messageBuilder); for (SMethod method : service.getMethods()) { String inputObjectName = StringUtils.firstUpperCase(method.getName()) + "Request"; String outputObjectName = StringUtils.firstUpperCase(method.getName()) + "Response";
constructor.setBody(sb.toString()); for (SMethod sMethod : sService.getMethods()) { CtClass[] parameters = new CtClass[sMethod.getParameters().size()]; int i=0;
stringBuffer.append(TEXT_9); for (SMethod method : sService.getMethods()) { for (SMethod method : sService.getMethods()) {
stringBuffer.append(TEXT_6); for (SMethod method : sService.getMethods()) {
out.println("\t\tservice = ServiceInterface.newBlockingStub(rpcChannel);"); out.println("\t}\n"); for (SMethod sMethod : sService.getMethods()) { String fullResultType = "void"; if (sMethod.returnsVoid()) {