Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.openyelp.client;
 
 import java.net.URL;
 
 
 public class RestFulClient {
 
 	public static <T> T getService(String url ,Class<T> classc) {
result = null;
		try {
			RestFul ful = classc.getAnnotation(RestFul.class);
			transport = new HttpJsonRpcClientTransport(new URL(url));
			JsonRpcInvoker invoker = new JsonRpcInvoker();
			String apiname = ful.value();
            if(apiname==null){
				apiname=classc.getSimpleName();
    			result = (T) invoker.get(transportapiname,classc);
            }else{
    			result = (T) invoker.get(transportful.value(),ful.api());
            }
catch (Exception e) {
		}
		return result;
	@SuppressWarnings("unchecked")
	public static <T> T getService(String url ,Class<T> classc,JsonRpcInvoker invoker,JsonRpcClientTransport jsonRpcClientTransport ) {
result = null;
		try {
			RestFul ful = classc.getAnnotation(RestFul.class);
			String apiname = ful.value();
            if(apiname==null){
				apiname=classc.getSimpleName();
    			result = (T) invoker.get(jsonRpcClientTransportapiname,classc);
            }else{
    			result = (T) invoker.get(jsonRpcClientTransportful.value(),ful.api());
            }
catch (Exception e) {
		}
		return result;
	public static <T> T getService(String url ,Class<T> classc,JsonRpcInvoker invoker ) {
result = null;
		try {
			RestFul ful = classc.getAnnotation(RestFul.class);
			transport = new HttpJsonRpcClientTransport(new URL(url));
			String apiname = ful.value();
            if(apiname==null){
				apiname=classc.getSimpleName();
    			result = (T) invoker.get(transportapiname,classc);
            }else{
    			result = (T) invoker.get(transportful.value(),ful.api());
            }
catch (Exception e) {
		}
		return result;
New to GrepCode? Check out our FAQ X