Get the number of elements in the JSONArray, included nulls. @return The length (or size).
Returns the number of elements in the array. @return the number of elements in the array.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
< public static <T> List<T> getListNotNull(JsonObject obj, String field, < JsonObjectParser<T> parser) throws JsonFormatException { < final JsonArray items = JsonInput.getArrayNotNull(obj, field); < final int length = items.size(); --- > public static <T> List<T> getListNotNull(JSONObject obj, String field, > JsonObjectParser<T> parser) throws JSONException { > final JSONArray items = getArrayNotNull(obj, field); > final int length = items.length();
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
< final int length = items.size(); --- > final int length = items.length();
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
< final int length = items.size(); --- > final JSONArray items = obj.getJSONArray(field); > final int length = items.length();
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksResponse.java
< for(int index = 0; index < jsonTasks.length(); index++) { --- > JsonElement element = new JsonParser().parse(getResponse()); > if(element.isJsonArray() == false) return tasks; > > JsonArray jsonTasks = element.getAsJsonArray(); > > for(int index = 0; index < jsonTasks.size(); index++) {
Get the string associated with a key. @param key A key string. @return A string which is the value. @throws JSONException if the key is not found.
Convenience method to get the specified member as a JsonPrimitive element. @param memberName name of the member being requested. @return the JsonPrimitive corresponding to the specified member.
Source code examples
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetUpdatedTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetDeletedTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetDeletedTasksResponse.java
< JSONArray jsonArray = createJSONArray(getResponse()); < < JSONObject info = jsonArray.getJSONObject(0); < int deletedCount = new Integer(info.getString("num")); --- > JsonElement element = new JsonParser().parse(getResponse()); > if(element.isJsonArray() == false) { > return ids; > } > > JsonArray jsonArray = element.getAsJsonArray(); > > JsonObject info = jsonArray.get(0).getAsJsonObject(); > > int deletedCount = new Integer(info.getAsJsonPrimitive("num").getAsInt());
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/SessionTokenResponse.java
Construct a JSONObject from a source JSON text string. This is the most commonly used JSONObject constructor. @param source A string beginning with { (left brace) and ending with (right brace). @exception JSONException If there is a syntax error in the source string.
This method deserializes the Json read from the specified reader into an object of the specified class. It is not suitable to use if the specified class is a generic type since it will not have the generic type information because of the Type Erasure feature of Java. Therefore, this method should not be used if the desired type is a generic type. Note that this method works fine if the any of the fields of the specified object are generics, just the object itself should not be a generic type. For the cases when the object is of generic type, invoke {@link #fromJson(Reader,Type). If you have the Json in a String form instead of a{@link Reader, use {@link #fromJson(String,Class) instead. @param the type of the desired object @param json the reader producing the Json from which the object is to be deserialized. @param classOfT the class of T @return an object of type T from the string @throws JsonIOException if there was a problem reading from the Reader @throws JsonSyntaxException if json is not a valid representation for an object of type @since 1.2
Source code examples
Repo https://github.com/NeonXero/uCritic - From 377e3e815e3004851eb87e762e16ab694575f303 - To 45d0071f1e8737fd7f854c897da02392a915ba02 File src/net/neonlotus/ucritic/PerformMovieSearch.java
Begin appending a new array. All values until the balancing endArray will be appended to this array. The endArray method must be called to mark the array's end. @return this @throws JSONException If the nesting is too deep, or if the object is started in the wrong place (for example as a key or after the end of the outermost array or object).
Begins encoding a new array. Each call to this method must be paired with a call to {@link #endArray. @return this writer.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/AddTasksRequest.java
< JSONStringer jsonWriter = new JSONStringer(); < jsonWriter.array(); --- > StringWriter sw = new StringWriter(); > JsonWriter jsonWriter = new JsonWriter(sw); > > jsonWriter.beginArray();
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/DeleteTasksRequest.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksRequest.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Construct a JSONObject from a source JSON text string. This is the most commonly used JSONObject constructor. @param source A string beginning with { (left brace) and ending with (right brace). @exception JSONException If there is a syntax error in the source string.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONParser.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONParser.java
< public static JsonObject getResponceSingleObject(String body, String key) < throws JsonFormatException { < try { < final JsonObject bodyJson = JsonInput.toObject(new JsonParser() < .parse(body)); < if (bodyJson == null) < throw new JsonFormatException("Empty input"); < final JsonObject contentJSon = JsonInput.getObjectNotNull(bodyJson, < key); < return contentJSon; < } catch (JsonParseException e) { < throw new JsonFormatException(e); < } --- > public static JSONObject getResponceSingleObject(String body, String key) > throws JSONException { > final JSONObject bodyJson = new JSONObject(body); > final JSONObject contentJSon = JsonInput > .getObjectNotNull(bodyJson, key); > return contentJSon;
Append a long value. @param l A long. @return this @throws JSONException
Encodes value. @return this writer.
Source code examples
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Get the string associated with a key. @param key A key string. @return A string which is the value. @throws JSONException if the key is not found.
convenience method to get this element as a String. @return get this element as a String.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetUpdatedTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetDeletedTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/SessionTokenResponse.java
Append a long value. @param l A long. @return this @throws JSONException
Encodes value. @param value the literal string value, or null to encode a null literal. @return this writer.
Source code examples
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
End an array. This method most be called to balance calls to array. @return this @throws JSONException If incorrectly nested.
Ends encoding the current array. @return this writer.
Source code examples
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Append an object value. @param o The object to append. It can be null, or a Boolean, Number, String, JSONObject, or JSONArray, or an object with a toJSONString() method. @return this @throws JSONException If the value is out of sequence.
Encodes value. @param value a finite value. May not be {@link Double#isNaN() NaNs or{@link Double#isInfinite() infinities. @return this writer.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Get the JSONObject associated with an index. @param index subscript @return A JSONObject value. @throws JSONException If there is no value for the index or if the value is not a JSONObject
convenience method to get this element as a {@link JsonObject. If the element is of some other type, a {@link ClassCastException will result. Hence it is best to use this method after ensuring that this element is of the desired type by calling {@link #isJsonObject()first. @return get this element as a {@link JsonObject. @throws IllegalStateException if the element is of another type.
Source code examples
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetDeletedTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetDeletedTasksResponse.java
< JSONArray jsonArray = createJSONArray(getResponse()); < < JSONObject info = jsonArray.getJSONObject(0); < int deletedCount = new Integer(info.getString("num")); --- > JsonElement element = new JsonParser().parse(getResponse()); > if(element.isJsonArray() == false) { > return ids; > } > > JsonArray jsonArray = element.getAsJsonArray(); > > JsonObject info = jsonArray.get(0).getAsJsonObject(); > > int deletedCount = new Integer(info.getAsJsonPrimitive("num").getAsInt());
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksResponse.java
Construct a JSONObject from a source JSON text string. This is the most commonly used JSONObject constructor. @param source A string beginning with { (left brace) and ending with (right brace). @exception JSONException If there is a syntax error in the source string.
Parses the specified JSON string into a parse tree @param json JSON text @return a parse tree of {@link JsonElements corresponding to the specified JSON @throws JsonParseException if the specified text is not valid JSON @since 1.3
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONParser.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONParser.java
< public static JsonObject getResponceSingleObject(String body, String key) < throws JsonFormatException { < try { < final JsonObject bodyJson = JsonInput.toObject(new JsonParser() < .parse(body)); < if (bodyJson == null) < throw new JsonFormatException("Empty input"); < final JsonObject contentJSon = JsonInput.getObjectNotNull(bodyJson, < key); < return contentJSon; < } catch (JsonParseException e) { < throw new JsonFormatException(e); < } --- > public static JSONObject getResponceSingleObject(String body, String key) > throws JSONException { > final JSONObject bodyJson = new JSONObject(body); > final JSONObject contentJSon = JsonInput > .getObjectNotNull(bodyJson, key); > return contentJSon;
Construct a JSONObject from a JSONTokener. @param x A JSONTokener object containing the source string. @throws JSONException If there is a syntax error in the source string.
Source code examples
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/SessionTokenResponse.java
Make a fresh JSONStringer. It can be used to build one JSON text.
Creates a new instance that writes a JSON-encoded stream to out. For best performance, ensure {@link Writer is buffered; wrapping in{@link java.io.BufferedWriter BufferedWriter if necessary.
Source code examples
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/AddTasksRequest.java
< JSONStringer jsonWriter = new JSONStringer(); < jsonWriter.array(); --- > StringWriter sw = new StringWriter(); > JsonWriter jsonWriter = new JsonWriter(sw); > > jsonWriter.beginArray();
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksRequest.java
Begin appending a new object. All keys and values until the balancing endObject will be appended to this object. The endObject method must be called to mark the object's end. @return this @throws JSONException If the nesting is too deep, or if the object is started in the wrong place (for example as a key or after the end of the outermost array or object).
Begins encoding a new object. Each call to this method must be paired with a call to {@link #endObject. @return this writer.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
< writer.beginObject(); --- > writer.object();
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
< writer.name("custom_field_values").beginObject(); < for (CustomField field : customFields) < writer.name(Integer.toString(field.getId())) < .value(field.getValue()); --- > writer.key("custom_field_values").object(); > for (CustomField field : customFields) { > writer.key(Integer.toString(field.getId())).value(field.getValue()); > }
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/AddTasksRequest.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/queryserver/master/QueryServerFE.java
Get the long value associated with a key. If the number value is too long for a long, it will be clipped. @param key A key string. @return The long value. @throws JSONException if the key is not found or if the value cannot be converted to a long.
convenience method to get this element as a primitive long. @return get this element as a primitive long. @throws NumberFormatException if the value contained is not a valid long.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
< public static long getLong(JsonObject obj, String field) < throws JsonFormatException { < final JsonPrimitive primitive = JsonInput.getPrimitiveNotNull(obj, < field); < try { < return primitive.getAsLong(); < } catch (NumberFormatException e) { < throw new JsonFormatException("Bad integer value " + primitive); < } --- > public static long getLong(JSONObject obj, String field) > throws JSONException { > return obj.getLong(field);
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetUpdatedTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksResponse.java
Get the long value associated with a key. If the number value is too long for a long, it will be clipped. @param key A key string. @return The long value. @throws JSONException if the key is not found or if the value cannot be converted to a long.
Convenience method to get the specified member as a JsonPrimitive element. @param memberName name of the member being requested. @return the JsonPrimitive corresponding to the specified member.
Source code examples
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetUpdatedTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksResponse.java
Append an object value. @param o The object to append. It can be null, or a Boolean, Number, String, JSONObject, or JSONArray, or an object with a toJSONString() method. @return this @throws JSONException If the value is out of sequence.
Encodes value. @return this writer.
Source code examples
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Construct a JSONObject from a JSONTokener. @param x A JSONTokener object containing the source string. @throws JSONException If there is a syntax error in the source string.
Parses the specified JSON string into a parse tree @param json JSON text @return a parse tree of {@link JsonElements corresponding to the specified JSON @throws JsonParseException if the specified text is not valid JSON @since 1.3
Source code examples
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/SessionTokenResponse.java
Get the JSONObject associated with an index. @param index subscript @return A JSONObject value. @throws JSONException If there is no value for the index or if the value is not a JSONObject
Returns the ith element of the array. @param i the index of the element that is being sought. @return the element present at the ith index. @throws IndexOutOfBoundsException if i is negative or greater than or equal to the{@link #size() of the array.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetDeletedTasksResponse.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/GetDeletedTasksResponse.java
< JSONArray jsonArray = createJSONArray(getResponse()); < < JSONObject info = jsonArray.getJSONObject(0); < int deletedCount = new Integer(info.getString("num")); --- > JsonElement element = new JsonParser().parse(getResponse()); > if(element.isJsonArray() == false) { > return ids; > } > > JsonArray jsonArray = element.getAsJsonArray(); > > JsonObject info = jsonArray.get(0).getAsJsonObject(); > > int deletedCount = new Integer(info.getAsJsonPrimitive("num").getAsInt());
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/UpdateTasksResponse.java
Append a key. The key will be associated with the next value. In an object, every value must be preceded by a key. @param s A key string. @return this @throws JSONException If the key is out of place. For example, keys do not belong in arrays or if the key is null.
Encodes the property name. @param name the name of the forthcoming value. May not be null. @return this writer.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
< public static void add(JsonWriter writer, String field, < Date value, final SimpleDateFormat format) throws IOException { < writer.name(field); --- > public static void add(JSONWriter writer, String field, > Date value, > final SimpleDateFormat format) throws JSONException { > writer.key(field);
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
< writer.name("custom_field_values").beginObject(); < for (CustomField field : customFields) < writer.name(Integer.toString(field.getId())) < .value(field.getValue()); --- > writer.key("custom_field_values").object(); > for (CustomField field : customFields) { > writer.key(Integer.toString(field.getId())).value(field.getValue()); > }
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/AddTasksRequest.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/queryserver/master/QueryServerFE.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/queryserver/master/QueryServerFE.java
Get the int value associated with a key. If the number value is too large for an int, it will be clipped. @param key A key string. @return The integer value. @throws JSONException if the key is not found or if the value cannot be converted to an integer.
convenience method to get this element as a primitive integer. @return get this element as a primitive integer. @throws NumberFormatException if the value contained is not a valid integer.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
< public static int getInt(JsonObject obj, String field) < throws JsonFormatException { < final JsonPrimitive primitive = JsonInput.getPrimitiveNotNull(obj, < field); < try { < return primitive.getAsInt(); < } catch (NumberFormatException e) { < throw new JsonFormatException("Bad integer value " + primitive); < } --- > public static int getInt(JSONObject obj, String field) throws JSONException { > return obj.getInt(field);
Append an object value. @param o The object to append. It can be null, or a Boolean, Number, String, JSONObject, or JSONArray, or an object with a toJSONString() method. @return this @throws JSONException If the value is out of sequence.
Encodes value. @param value the literal string value, or null to encode a null literal. @return this writer.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonOutput.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
Repo https://github.com/sergevm/ToodledoJavaClient - From 65c717769d9342396d26e2a070a006b817492525 - To 4bb1295ec4733d3ccab79fd157ad65166a16edc1 File toodledo/src/com/domaindriven/toodledo/AddTasksRequest.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
Determine if the JSONObject contains a specific key. @param key A key string. @return true if the key exists in the JSONObject.
Returns the member with the specified name. @param memberName name of the member that is being requested. @return the member matching the name. Null if no such member exists.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
< public static JsonObject getObjectOrNull(JsonObject obj, String field) < throws JsonFormatException { < final JsonElement elt = obj.get(field); < return JsonInput.toObject(elt); < } < < /** < * Converts element to object. < * < * @param elt < * element to convert. < * @return element as object value. < * @throws JsonFormatException < * if element is not an object value. < */ < public static JsonObject toObject(JsonElement elt) < throws JsonFormatException { < if (elt == null || elt.isJsonNull()) < return null; < if (elt.isJsonObject()) < return elt.getAsJsonObject(); < throw new JsonFormatException("Expected object but got " < + elt.getClass() + " in content " + elt); < } < < /** < * Converts element to array. < * < * @param elt < * element to convert. < * @return element as object value. < * @throws JsonFormatException < * if element is not an object value. < */ < public static JsonArray toArray(JsonElement elt) throws JsonFormatException { < if (elt == null || elt.isJsonNull()) --- > public static JSONObject getObjectOrNull(JSONObject obj, String field) > throws JSONException { > if (!obj.has(field) || obj.isNull(field))
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Make a fresh JSONWriter. It can be used to build one JSON text.
Creates a new instance that writes a JSON-encoded stream to out. For best performance, ensure {@link Writer is buffered; wrapping in{@link java.io.BufferedWriter BufferedWriter if necessary.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
< final JsonWriter jsWriter = new JsonWriter(swriter); --- > final JSONWriter jsWriter = new JSONWriter(swriter);
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
< JSONWriter jsonWriter = new JSONWriter(writer); --- > JsonWriter jsonWriter = new JsonWriter(writer);
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
< JSONWriter jsonWriter= new JSONWriter(writer); --- > JsonWriter jsonWriter= new JsonWriter(writer);
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/listcrawler/CrawlListsUI.java
< JSONWriter jsonWriter = new JSONWriter(writer); --- > JsonWriter jsonWriter = new JsonWriter(writer);
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
< JSONWriter jsonWriter = new JSONWriter(writer); --- > JsonWriter jsonWriter = new JsonWriter(writer);
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
< JSONWriter jsonWriter = new JSONWriter(writer); --- > JsonWriter jsonWriter = new JsonWriter(writer);
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
< JSONWriter jsonWriter = new JSONWriter(writer); --- > JsonWriter jsonWriter = new JsonWriter(writer);
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/util/PatternListEditor.java
< JSONWriter jsonWriter = new JSONWriter(writer); --- > JsonWriter jsonWriter = new JsonWriter(writer);
Repo https://github.com/commoncrawl/commoncrawl-crawler - From 8cb9b65d93bbc8192c998be6e22bffd927742133 - To e0ed0916a8b1a86682f26e35087bdca2bee097fe File src/org/commoncrawl/service/queryserver/master/QueryServerFE.java
< JSONWriter jsonWriter = new JSONWriter(writer); --- > JsonWriter jsonWriter = new JsonWriter(writer);
Get the JSONObject value associated with a key. @param key A key string. @return A JSONObject which is the value. @throws JSONException if the key is not found or if the value is not a JSONObject.
provides check for verifying if this element is an array or not. @return true if this element is of type {@link JsonArray, false otherwise.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
< if (elt.isJsonArray()) < return elt.getAsJsonArray(); < throw new JsonFormatException("Expected array but got " < + elt.getClass() + " in content " + elt); --- > return obj.getJSONObject(field);
Get the double value associated with a key. @param key A key string. @return The numeric value. @throws JSONException if the key is not found or if the value is not a Number object and cannot be converted to a number.
convenience method to get this element as a float. @return get this element as a float. @throws NumberFormatException if the value contained is not a valid float.
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
Determine if the value associated with the key is null or if there is no value. @param key A key string. @return true if there is no value associated with the key or if the value is the JSONObject.NULL object.
provides check for verifying if this element represents a null value or not. @return true if this element is of type {@link JsonNull, false otherwise. @since 1.2
Source code examples
Repo https://github.com/taskadapter/redmine-java-api - From 2e8ccfa240792695cd7505a9137b3a25556d42a4 - To 18a73dfb0b0cbd6366915f5da64269752d85e17a File src/main/java/org/redmine/ta/internal/json/JsonInput.java
< public static JsonObject getObjectOrNull(JsonObject obj, String field) < throws JsonFormatException { < final JsonElement elt = obj.get(field); < return JsonInput.toObject(elt); < } < < /** < * Converts element to object. < * < * @param elt < * element to convert. < * @return element as object value. < * @throws JsonFormatException < * if element is not an object value. < */ < public static JsonObject toObject(JsonElement elt) < throws JsonFormatException { < if (elt == null || elt.isJsonNull()) < return null; < if (elt.isJsonObject()) < return elt.getAsJsonObject(); < throw new JsonFormatException("Expected object but got " < + elt.getClass() + " in content " + elt); < } < < /** < * Converts element to array. < * < * @param elt < * element to convert. < * @return element as object value. < * @throws JsonFormatException < * if element is not an object value. < */ < public static JsonArray toArray(JsonElement elt) throws JsonFormatException { < if (elt == null || elt.isJsonNull()) --- > public static JSONObject getObjectOrNull(JSONObject obj, String field) > throws JSONException { > if (!obj.has(field) || obj.isNull(field))