Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
retrofit [2017/06/22 14:04] ledyxretrofit [2021/02/07 05:49] (current) – old revision restored (2017/06/22 14:06) ledyx
Line 50: Line 50:
         T service = (T) services.get(restfulInterface.getName());         T service = (T) services.get(restfulInterface.getName());
  
-        if(service == null) { +        if(service == null) {          
-            /*Field f = restfulInterface.getField("URL"); +            if(!restfulInterface.isAnnotationPresent(URL.class))
-            String url = (String) f.get(null);*/ +
-         +
-        if(!restfulInterface.isAnnotationPresent(URL.class))+
         throw new Exception("Must be annotated URL");         throw new Exception("Must be annotated URL");
                 
-        URL urlAnnotation = restfulInterface.getDeclaredAnnotation(URL.class);+            URL urlAnnotation = restfulInterface.getDeclaredAnnotation(URL.class);
                 
-        String url = urlAnnotation.value(); +            String url = urlAnnotation.value(); 
-         if(url.length() <= 0 || !url.substring(0, 4).equals("http"))+            if(url.length() <= 0 || !url.substring(0, 4).equals("http"))
         throw new Exception("Unavailable URL value");         throw new Exception("Unavailable URL value");
                 
-        boolean isUnwrapRootValue = urlAnnotation.isUnwrappedRoot();+            boolean isUnwrapRootValue = urlAnnotation.isUnwrappedRoot();
  
             HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();             HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
retrofit.1498136677.txt.gz · Last modified: 2021/02/07 03:15 (external edit)