cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Keeping ParseConfiguration emptu for now
Date Mon, 24 Jul 2017 12:50:18 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes ad8d74672 -> 16a275642


Keeping ParseConfiguration emptu for now


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/16a27564
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/16a27564
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/16a27564

Branch: refs/heads/3.1.x-fixes
Commit: 16a275642f2621ce23772bacfd88a4bd93334e20
Parents: ad8d746
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Jul 24 15:49:21 2017 +0300
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Jul 24 15:50:07 2017 +0300

----------------------------------------------------------------------
 .../jaxrs/swagger/parse/ParseConfiguration.java | 22 --------------------
 .../jaxrs/swagger/parse/SwaggerParseUtils.java  | 21 ++++++++++++-------
 2 files changed, 14 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/16a27564/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/ParseConfiguration.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/ParseConfiguration.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/ParseConfiguration.java
index 18e5b67..bf1f8e4 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/ParseConfiguration.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/ParseConfiguration.java
@@ -18,30 +18,8 @@
  */
 package org.apache.cxf.jaxrs.swagger.parse;
 
-import org.apache.cxf.Bus;
-
 public class ParseConfiguration {
-    private String docLocation;
-    private Bus bus;
     
     public ParseConfiguration() {
     }
-    
-    public ParseConfiguration(String docLocation, Bus bus) {
-        this.docLocation = docLocation;
-        this.bus = bus;
-    }
-    
-    public String getDocLocation() {
-        return docLocation;
-    }
-    public void setDocLocation(String docLocation) {
-        this.docLocation = docLocation;
-    }
-    public Bus getBus() {
-        return bus;
-    }
-    public void setBus(Bus bus) {
-        this.bus = bus;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/16a27564/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/SwaggerParseUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/SwaggerParseUtils.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/SwaggerParseUtils.java
index 06aa761..fe8a96e 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/SwaggerParseUtils.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/SwaggerParseUtils.java
@@ -69,25 +69,32 @@ public final class SwaggerParseUtils {
         return getUserApplication(loc, BusFactory.getThreadDefaultBus());
     }
     public static UserApplication getUserApplication(String loc, Bus bus) {
-        return getUserApplication(new ParseConfiguration(loc, bus));
+        return getUserApplication(loc, bus, new ParseConfiguration());
     }    
-    public static UserApplication getUserApplication(ParseConfiguration cfg) {    
+    public static UserApplication getUserApplication(String loc, Bus bus, ParseConfiguration
cfg) {    
         try {
-            InputStream is = ResourceUtils.getResourceStream(cfg.getDocLocation(),
-                                                             cfg.getBus());
+            InputStream is = ResourceUtils.getResourceStream(loc, bus);
             if (is == null) {
                 return null;
             }
-            return getUserApplicationFromStream(is);
+            return getUserApplicationFromStream(is, cfg);
         } catch (Exception ex) {
-            LOG.warning("Problem with processing a user model at " + cfg.getDocLocation());
+            LOG.warning("Problem with processing a user model at " + loc);
         }
         return null;
     }
     public static UserApplication getUserApplicationFromStream(InputStream is) throws IOException
{
-        return getUserApplicationFromJson(IOUtils.readStringFromStream(is));
+        return getUserApplicationFromStream(is, new ParseConfiguration());
+    }
+    public static UserApplication getUserApplicationFromStream(InputStream is,
+                                                               ParseConfiguration cfg) throws
IOException {
+        return getUserApplicationFromJson(IOUtils.readStringFromStream(is), cfg);
     }
     public static UserApplication getUserApplicationFromJson(String json) {
+        return getUserApplicationFromJson(json, new ParseConfiguration());
+    }
+    public static UserApplication getUserApplicationFromJson(String json,
+                                                             ParseConfiguration cfg) {
         JsonMapObjectReaderWriter reader = new JsonMapObjectReaderWriter();
         Map<String, Object> map = reader.fromJson(json);
     


Mime
View raw message