Examples of JSONTokener


Examples of ar.com.restba.json.JsonTokener

   * @exception JsonException
   *              If there is a syntax error in the source string or a
   *              duplicated key.
   */
  public JsonObject(String source) {
    this(new JsonTokener(source));
  }
View Full Code Here

Examples of facebook4j.internal.org.json.JSONTokener

        if (json == null) {
            Reader reader = null;
            try {
                if (responseAsString == null) {
                    reader = asReader();
                    json = new JSONObject(new JSONTokener(reader));
                } else {
                    json = new JSONObject(responseAsString);
                }
                if (CONF.isPrettyDebugEnabled()) {
                    logger.debug(json.toString(1));
View Full Code Here

Examples of flexjson.JSONTokener

                TSocket socket = new TSocket(seed, port_);
                TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
                Cassandra.Client client = new Cassandra.Client(binaryProtocol);
                socket.open();

                Map<String,String> tokenToHostMap = (Map<String,String>) new JSONTokener(client.get_string_property(CassandraServer.TOKEN_MAP)).nextValue();
               
                BiMap<Token, InetAddress> tokenEndpointMap = HashBiMap.create();
                for (Map.Entry<String,String> entry : tokenToHostMap.entrySet())
                {
                    Token token = StorageService.getPartitioner().getTokenFactory().fromString(entry.getKey());
View Full Code Here

Examples of net.sf.json.util.JSONTokener

    JSONObject designDoc = new JSONObject();
    try {
      JSONDirectoryBuilder builder = new JSONDirectoryBuilder(ddDir);
      builder.write(ddWriter);

      JSONTokener jsonTokener = new JSONTokener(ddWriter.toString());
      Object obj = jsonTokener.nextValue();
      if( obj instanceof JSONObject ) {
        designDoc = (JSONObject)obj;
      } else {
        throw new Exception("Unexpected returned object type: "+obj.getClass().getSimpleName());
      }
View Full Code Here

Examples of net.yacy.cora.document.JSONTokener

            final byte[] content = postToFile(target, "idx.json", parts, 30000);
            if (content == null || content.length == 0) {
                yacyCore.log.logWarning("yacyClient.loadIDXHosts error: empty result");
                return null;
            }
            final JSONObject json = new JSONObject(new JSONTokener(new InputStreamReader(new ByteArrayInputStream(content))));
            /* the json has the following form:
            {
            "version":"#[version]#",
            "uptime":"#[uptime]#",
            "name":"#[name]#",
View Full Code Here

Examples of org.activiti.engine.impl.util.json.JSONTokener

    gridLayout.setSpacing(true);
    addComponent(gridLayout);
   
    InputStream contentStream = taskService.getAttachmentContent(attachment.getId());
    // TODO: Error handling
    JSONObject emailJson = new JSONObject(new JSONTokener(new InputStreamReader(contentStream)));

    String html = emailJson.getString(Constants.EMAIL_HTML_CONTENT);
    String subject = emailJson.getString(Constants.EMAIL_SUBJECT);
    String recipients = emailJson.getString(Constants.EMAIL_RECIPIENT);
    String sentDate = emailJson.getString(Constants.EMAIL_SENT_DATE);
View Full Code Here

Examples of org.amplafi.json.JSONTokener

            j = new JSONObject("{script: 'It is not allowed in HTML to send a close script tag in a string<script>because it confuses browsers</script>so we insert a backslash before the /'}");
            System.out.println(j.toString());
            System.out.println("");

            JSONTokener jt = new JSONTokener("{op:'test', to:'session', pre:1}{op:'test', to:'session', pre:2}");
            j = new JSONObject(jt);
            System.out.println(j.toString());
            System.out.println("pre: " + j.optInt("pre"));
            int i = jt.skipTo('{');
            System.out.println(i);
            j = new JSONObject(jt);
            System.out.println(j.toString());
            System.out.println("");
View Full Code Here

Examples of org.apache.sling.commons.json.JSONTokener

        // Execute tests from the failingtests bundle and verify response
        final Request r = getRequestBuilder().buildPostRequest(JUNIT_SERVLET_PATH
                + "/org.apache.sling.testing.samples.failingtests.json").withCredentials(getServerUsername(), getServerPassword());
        getRequestExecutor().execute(r).assertStatus(200);
       
        final JSONArray json = new JSONArray(new JSONTokener((getRequestExecutor().getContent())));
       
        assertEquals(
                "initializationError(org.apache.sling.testing.samples.failingtests.EmptyTest): No runnable methods",
                getFailure(json, "org.apache.sling.testing.samples.failingtests.EmptyTest")
        );
View Full Code Here

Examples of org.apache.sling.commons.json.JSONTokener

                "org.apache.sling.junit.scriptable.ScriptableTestsProvider",
                null,
                "json"
                );
        executor.assertContentType("application/json");
        final JSONArray json = new JSONArray(new JSONTokener((executor.getContent())));
       
        int testsCount = 0;
        final List<String> failures = new ArrayList<String>();
        for(int i = 0 ; i < json.length(); i++) {
            final JSONObject obj = json.getJSONObject(i);
View Full Code Here

Examples of org.apache.sling.commons.json.JSONTokener

                testParameters.getTestClassesSelector(),
                testParameters.getTestMethodSelector(),
                "json"
                );
        executor.assertContentType("application/json");
        final JSONArray json = new JSONArray(new JSONTokener((executor.getContent())));

        // Response contains an array of objects identified by
        // their INFO_TYPE, extract the tests
        // based on this vlaue
        for(int i = 0 ; i < json.length(); i++) {
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.