public SClass getType(String name) { for (SService sService : servicesByName.values()) { SClass type = sService.getServicesMap().getSType(name); if (type != null) { return type; } } return null; }
public void init() { for (Method method : interfaceClass.getMethods()) { getServicesMap().addType(method.getReturnType()); if (getGenericType(method) != null) { getServicesMap().addType(getGenericType(method)); } for (Class<?> paramType : method.getParameterTypes()) { getServicesMap().addType(paramType); } } for (SClass sType : getServicesMap().getTypes()) { sType.init(); } for (Method method : interfaceClass.getMethods()) { methods.put(method.getName(), new SMethod(this, method)); } if (processJavaDoc && sourceCodeFetcher != null) { processClass(interfaceClass); } }
public <T extends PublicInterface, K extends PublicInterface> Object invoke(Class<K> clazz, T service, KeyValuePair[] keyValuePairs) throws ServiceException, ReflectorException { Reflector reflector = null; if (reflectorCache.containsKey(service)) { reflector = reflectorCache.get(service); } else { reflector = this.service.getServicesMap().getReflectorFactory().createReflector(clazz, service); reflectorCache.put(service, reflector); } return reflector.callMethod(clazz.getName(), getName(), getReturnType().getInstanceClass(), keyValuePairs); }
parameters.add(new SParameter(this, service.getServicesMap().getSType(parameterType.getName()), genericType == null ? null : service.getServicesMap().getSType(genericType.getName()), paramName)); parameterCounter++; this.returnType = service.getServicesMap().getSType(method.getReturnType().getName()); if (method.getReturnType() == List.class || method.getReturnType() == Set.class) { Type genericReturnType = method.getGenericReturnType(); Type type = parameterizedType.getActualTypeArguments()[0]; if (type instanceof Class) { this.genericReturnType = service.getServicesMap().getSType(((Class)type).getName());