Package javax.json

Examples of javax.json.JsonArray


  }

  private void parseChildren(ParserState<?> theState, String theName, JsonValue theJsonVal, JsonValue theAlternateVal) {
    switch (theJsonVal.getValueType()) {
    case ARRAY: {
      JsonArray nextArray = (JsonArray) theJsonVal;
      JsonArray nextAlternateArray = (JsonArray) theAlternateVal;
      for (int i = 0; i < nextArray.size(); i++) {
        JsonValue nextObject = nextArray.get(i);
        JsonValue nextAlternate = null;
        if (nextAlternateArray != null) {
          nextAlternate = nextAlternateArray.get(i);
        }
        parseChildren(theState, theName, nextObject, nextAlternate);
      }
      break;
    }
View Full Code Here


      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);
          parseExtension(theState, jsonVal, false);
        } else if ("modifierExtension".equals(next)) {
          JsonArray jsonVal = (JsonArray) nextExtObj.get(next);
          parseExtension(theState, jsonVal, true);
        } else {
          JsonValue jsonVal = nextExtObj.get(next);
          parseChildren(theState, next, jsonVal, null);
        }
View Full Code Here

    for (Entry<String, JsonValue> nextEntry : alternate.entrySet()) {
      String nextKey = nextEntry.getKey();
      JsonValue nextVal = nextEntry.getValue();
      if ("extension".equals(nextKey)) {
        boolean isModifier = false;
        JsonArray array = (JsonArray) nextEntry.getValue();
        parseExtension(theState, array, isModifier);
      } else if ("modifierExtension".equals(nextKey)) {
        boolean isModifier = true;
        JsonArray array = (JsonArray) nextEntry.getValue();
        parseExtension(theState, array, isModifier);
      } else if ("id".equals(nextKey)) {
        switch (nextVal.getValueType()) {
        case STRING:
          theState.attributeValue("id", ((JsonString) nextVal).getString());
View Full Code Here

  private void parseBundleChildren(JsonObject theObject, ParserState<?> theState) {
    for (String nextName : theObject.keySet()) {
      if ("resourceType".equals(nextName)) {
        continue;
      } else if ("link".equals(nextName)) {
        JsonArray entries = theObject.getJsonArray(nextName);
        for (JsonValue jsonValue : entries) {
          theState.enteringNewElement(null, "link");
          JsonObject linkObj = (JsonObject) jsonValue;
          String rel = linkObj.getString("rel", null);
          String href = linkObj.getString("href", null);
          theState.attributeValue("rel", rel);
          theState.attributeValue("href", href);
          theState.endingElement();
        }
        continue;
      } else if ("entry".equals(nextName)) {
        JsonArray entries = theObject.getJsonArray(nextName);
        for (JsonValue jsonValue : entries) {
          theState.enteringNewElement(null, "entry");
          parseBundleChildren((JsonObject) jsonValue, theState);
          theState.endingElement();
        }
View Full Code Here

        continue;
      } else if ("id".equals(nextName)) {
        elementId = theObject.getString(nextName);
        continue;
      } else if ("extension".equals(nextName)) {
        JsonArray array = theObject.getJsonArray(nextName);
        parseExtension(theState, array, false);
        continue;
      } else if ("modifierExtension".equals(nextName)) {
        JsonArray array = theObject.getJsonArray(nextName);
        parseExtension(theState, array, true);
        continue;
      } else if (nextName.charAt(0) == '_') {
        continue;
      }
View Full Code Here

  }

  private void parseChildren(ParserState<?> theState, String theName, JsonValue theJsonVal, JsonValue theAlternateVal) {
    switch (theJsonVal.getValueType()) {
    case ARRAY: {
      JsonArray nextArray = (JsonArray) theJsonVal;
      JsonArray nextAlternateArray = (JsonArray) theAlternateVal;
      for (int i = 0; i < nextArray.size(); i++) {
        JsonValue nextObject = nextArray.get(i);
        JsonValue nextAlternate = null;
        if (nextAlternateArray != null) {
          nextAlternate = nextAlternateArray.get(i);
        }
        parseChildren(theState, theName, nextObject, nextAlternate);
      }
      break;
    }
View Full Code Here

      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);
          parseExtension(theState, jsonVal, false);
        } else if ("modifierExtension".equals(next)) {
          JsonArray jsonVal = (JsonArray) nextExtObj.get(next);
          parseExtension(theState, jsonVal, true);
        } else {
          JsonValue jsonVal = nextExtObj.get(next);
          parseChildren(theState, next, jsonVal, null);
        }
View Full Code Here

    for (Entry<String, JsonValue> nextEntry : alternate.entrySet()) {
      String nextKey = nextEntry.getKey();
      JsonValue nextVal = nextEntry.getValue();
      if ("extension".equals(nextKey)) {
        boolean isModifier = false;
        JsonArray array = (JsonArray) nextEntry.getValue();
        parseExtension(theState, array, isModifier);
      } else if ("modifierExtension".equals(nextKey)) {
        boolean isModifier = true;
        JsonArray array = (JsonArray) nextEntry.getValue();
        parseExtension(theState, array, isModifier);
      } else if ("id".equals(nextKey)) {
        switch (nextVal.getValueType()) {
        case STRING:
          theState.attributeValue("id", ((JsonString) nextVal).getString());
View Full Code Here

  private void parseBundleChildren(JsonObject theObject, ParserState<?> theState) {
    for (String nextName : theObject.keySet()) {
      if ("resourceType".equals(nextName)) {
        continue;
      } else if ("link".equals(nextName)) {
        JsonArray entries = theObject.getJsonArray(nextName);
        for (JsonValue jsonValue : entries) {
          theState.enteringNewElement(null, "link");
          JsonObject linkObj = (JsonObject) jsonValue;
          String rel = linkObj.getString("rel", null);
          String href = linkObj.getString("href", null);
          theState.attributeValue("rel", rel);
          theState.attributeValue("href", href);
          theState.endingElement();
        }
        continue;
      } else if ("entry".equals(nextName)) {
        JsonArray entries = theObject.getJsonArray(nextName);
        for (JsonValue jsonValue : entries) {
          theState.enteringNewElement(null, "entry");
          parseBundleChildren((JsonObject) jsonValue, theState);
          theState.endingElement();
        }
View Full Code Here

        continue;
      } else if ("id".equals(nextName)) {
        elementId = theObject.getString(nextName);
        continue;
      } else if ("extension".equals(nextName)) {
        JsonArray array = theObject.getJsonArray(nextName);
        parseExtension(theState, array, false);
        continue;
      } else if ("modifierExtension".equals(nextName)) {
        JsonArray array = theObject.getJsonArray(nextName);
        parseExtension(theState, array, true);
        continue;
      } else if (nextName.charAt(0) == '_') {
        continue;
      }
View Full Code Here

TOP

Related Classes of javax.json.JsonArray

Copyright © 2018 www.massapicom. 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.