Package org.json

Examples of org.json.JSONArray.optString()


                // Markdown to HTML for content and abstract
                markdown(article);

                // Remove unused properties
                for (int j = 0; j < excludes.length(); j++) {
                    article.remove(excludes.optString(j));
                }
            }

            ret.put(ARTICLES, articles);
View Full Code Here


                // Markdown to HTML for content and abstract
                markdown(article);

                // Remove unused properties
                for (int j = 0; j < excludes.length(); j++) {
                    article.remove(excludes.optString(j));
                }
            }

            ret.put(ARTICLES, articles);
View Full Code Here

        assertEquals(0, gadget.getInt("moduleId"));
        first = true;
      } else {
        JSONArray errors = gadget.getJSONArray("errors");
        assertEquals(1, errors.length());
        assertEquals("broken", errors.optString(0));
        second = true;
      }
    }

    assertTrue("First gadget not returned!", first);
View Full Code Here

      filters = scannerDescriptor.optString(RESTConstants.SCANNER_FILTER);

      if (columnArray != null) {
        columns = new byte[columnArray.length()][];
        for (int i = 0; i < columnArray.length(); i++) {
          columns[i] = Bytes.toBytes(columnArray.optString(i));
        }
      }

      return new ScannerDescriptor(columns, timestamp, startRow, stopRow,
          filters);
View Full Code Here

    private JSONObject serializeJSONObject(final BeanSerializerState state,
            final Object parent, final JSONObject jsonobject) {
        final JSONObject result = new JSONObject();
        final JSONArray keys = jsonobject.names();
        for (int i = 0; i < keys.length(); i++) {
            final String key = keys.optString(i);
            final Object object = jsonobject.opt(key);
            this.putInObject(state, parent, key, object, result);
        }
        return result;
    }
View Full Code Here

        assertEquals(0, gadget.getInt("moduleId"));
        first = true;
      } else {
        JSONArray errors = gadget.getJSONArray("errors");
        assertEquals(1, errors.length());
        assertEquals("broken", errors.optString(0));
        second = true;
      }
    }

    assertTrue("First gadget not returned!", first);
View Full Code Here

        assertEquals(0, gadget.getInt("moduleId"));
        first = true;
      } else {
        JSONArray errors = gadget.getJSONArray("errors");
        assertEquals(1, errors.length());
        assertEquals("broken", errors.optString(0));
        second = true;
      }
    }

    assertTrue("First gadget not returned!", first);
View Full Code Here

    List<String> toReturn = new ArrayList<String>();
    if (staticOpenFilters != null ) {
      JSONArray values = staticOpenFilters.optJSONArray(openFilterId);
      if (values != null && values.length() > 0) {
        for (int i = 0; i < values.length(); i++)
          if (values.optString(i) != null) {
            toReturn.add(values.optString(i));
          };
      }
    }
    logger.debug("OUT: returning " + toReturn);
View Full Code Here

    if (staticOpenFilters != null ) {
      JSONArray values = staticOpenFilters.optJSONArray(openFilterId);
      if (values != null && values.length() > 0) {
        for (int i = 0; i < values.length(); i++)
          if (values.optString(i) != null) {
            toReturn.add(values.optString(i));
          };
      }
    }
    logger.debug("OUT: returning " + toReturn);
    return toReturn;
View Full Code Here

      }
      // We need to add on the columns and identifiers for all the lines, even
      // for the first line.
      lineOffsets.add((byte) (line - lastLine));
      columns.add((short) mapArray.getInt(2));
      identifiers.add(interner.intern(mapArray.optString(3, "")));
      lastLine = line;
    }
    if (currentFile != null) {
      FileName dirFile = splitFileName(interner, currentFile);
      SourceFile.Builder builder = SourceFile.newBuilder()
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.