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:49:37 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f33f5f5bf -> 1502f6ca3


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/1502f6ca
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1502f6ca
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1502f6ca

Branch: refs/heads/master
Commit: 1502f6ca31914b33364774da1211cff397b0ed54
Parents: f33f5f5
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:49:21 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/1502f6ca/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/1502f6ca/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 d728bdf..bfa4301 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