Package javax.json

Examples of javax.json.JsonObject.keySet()


        if (response == null) {
            return empty;
        }
        int length = response.size();
        String retVal[] = new String[length];
        Iterator keyIterator = response.keySet().iterator();
        int counter = 0;
        while (keyIterator.hasNext()) {
            retVal[counter++] = (String) keyIterator.next();
        }
        return retVal;
View Full Code Here


      System.out.print("Key " + key + ": ");
    switch (tree.getValueType()) {
    case OBJECT:
      System.out.println("OBJECT");
      JsonObject object = (JsonObject) tree;
      for (String name : object.keySet())
        navigateTree(object.get(name), name);
      break;
    case ARRAY:
      System.out.println("ARRAY");
      JsonArray array = (JsonArray) tree;
View Full Code Here

        }
        result = result.getJsonObject(JSON_OBJECT_CHILD_RESOURCES);
        if (result == null) {
            return null;
        }
        return result.keySet();
    }
   
    public JsonArray getExtraProperties(String path) {
        JsonObject result = managementResource.path(path).request(MediaType.APPLICATION_JSON).get(JsonObject.class);
        result = result.getJsonObject(JSON_OBJECT_EXTRA_PROPERTIES);
View Full Code Here

  private void parseExtension(ParserState<?> theState, JsonArray array, boolean theIsModifier) {
    for (int i = 0; i < array.size(); i++) {
      JsonObject nextExtObj = array.getJsonObject(i);
      String url = nextExtObj.getString("url");
      theState.enteringNewElementExtension(null, url, theIsModifier);
      for (Iterator<String> iter = nextExtObj.keySet().iterator(); iter.hasNext();) {
        String next = iter.next();
        if ("url".equals(next)) {
          continue;
        } else if ("extension".equals(next)) {
          JsonArray jsonVal = (JsonArray) nextExtObj.get(next);
View Full Code Here

  private void parseExtension(ParserState<?> theState, JsonArray array, boolean theIsModifier) {
    for (int i = 0; i < array.size(); i++) {
      JsonObject nextExtObj = array.getJsonObject(i);
      String url = nextExtObj.getString("url");
      theState.enteringNewElementExtension(null, url, theIsModifier);
      for (Iterator<String> iter = nextExtObj.keySet().iterator(); iter.hasNext();) {
        String next = iter.next();
        if ("url".equals(next)) {
          continue;
        } else if ("extension".equals(next)) {
          JsonArray jsonVal = (JsonArray) nextExtObj.get(next);
View Full Code Here

  private void parseExtension(ParserState<?> theState, JsonArray array, boolean theIsModifier) {
    for (int i = 0; i < array.size(); i++) {
      JsonObject nextExtObj = array.getJsonObject(i);
      String url = nextExtObj.getString("url");
      theState.enteringNewElementExtension(null, url, theIsModifier);
      for (Iterator<String> iter = nextExtObj.keySet().iterator(); iter.hasNext();) {
        String next = iter.next();
        if ("url".equals(next)) {
          continue;
        } else if ("extension".equals(next)) {
          JsonArray jsonVal = (JsonArray) nextExtObj.get(next);
View Full Code Here

    // TODO: use theIsModifier
    for (int i = 0; i < array.size(); i++) {
      JsonObject nextExtObj = array.getJsonObject(i);
      String url = nextExtObj.getString("url");
      theState.enteringNewElementExtension(null, url, theIsModifier);
      for (Iterator<String> iter = nextExtObj.keySet().iterator(); iter.hasNext();) {
        String next = iter.next();
        if ("url".equals(next)) {
          continue;
        } else if ("extension".equals(next)) {
          JsonArray jsonVal = (JsonArray) nextExtObj.get(next);
View Full Code Here

  private void parseExtension(ParserState<?> theState, JsonArray array, boolean theIsModifier) {
    for (int i = 0; i < array.size(); i++) {
      JsonObject nextExtObj = array.getJsonObject(i);
      String url = nextExtObj.getString("url");
      theState.enteringNewElementExtension(null, url, theIsModifier);
      for (Iterator<String> iter = nextExtObj.keySet().iterator(); iter.hasNext();) {
        String next = iter.next();
        if ("url".equals(next)) {
          continue;
        } else if ("extension".equals(next)) {
          JsonArray jsonVal = (JsonArray) nextExtObj.get(next);
View Full Code Here

   */
  private void parseMessage(final String msg)
      throws SimulationContextException {
    JsonObject jsonObject = Json.createReader(new StringReader(msg))
        .readObject();
    for (String key : jsonObject.keySet()) {
      String value = jsonObject.getString(key).trim();
      if (key.trim().equalsIgnoreCase("roomId")) {
        roomId = value;
        server.setClientLocation(clientSocket.getInetAddress()
            .getHostAddress(), roomId);
View Full Code Here

    }

    JsonObject preferencesObject = simulationObject
        .getJsonObject("preferences");
    if (preferencesObject != null) {
      for (String key : preferencesObject.keySet()) {
        simulation.getContext().setPreference(key,
            preferencesObject.getString(key));
      }
    }
    return simulation;
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.