velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1868995 - /velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java
Date Sat, 26 Oct 2019 09:43:27 GMT
Author: cbrisson
Date: Sat Oct 26 09:43:26 2019
New Revision: 1868995

URL: http://svn.apache.org/viewvc?rev=1868995&view=rev
Log:
[tools] JsonContent getObject() and getArray() methods to get access to underlying oject

Modified:
    velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java

Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java?rev=1868995&r1=1868994&r2=1868995&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java
(original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java
Sat Oct 26 09:43:26 2019
@@ -188,8 +188,8 @@ public class JsonContent
     }
 
     /**
-     * Check if wrapped object is a JSONObject
-     * @return true if wrapped object is a JSONObject
+     * Check if wrapped object is a JsonObject
+     * @return true if wrapped object is a JsonObject
      */
     public boolean isObject()
     {
@@ -197,11 +197,30 @@ public class JsonContent
     }
 
     /**
-     * Check if wrapped object is a JSONArray
-     * @return true if wrapped object is a JSONArray
+     * Check if wrapped object is a JsonArray
+     * @return true if wrapped object is a JsonArray
      */
     public boolean isArray()
     {
         return jsonArray != null;
     }
+
+    /**
+     * Gives access to the wrapped JsonObject, if any
+     * @return JsonObject or null
+     */
+    public JsonObject getObject()
+    {
+        return jsonObject;
+    }
+
+    /**
+     * Gives acces to the wrapped JsonArray, if any
+     * @return JsonArray or null
+     */
+    public JsonArray getArray()
+    {
+        return jsonArray;
+    }
+
 }



Mime
View raw message