Package javax.json

Examples of javax.json.JsonValue


      return;
    }
    JsonObject alternate = (JsonObject) theAlternateVal;
    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());
          break;
        case NULL:
          break;
View Full Code Here


  @Override
  public <T extends IResource> Bundle parseBundle(Class<T> theResourceType, Reader theReader) {
    JsonReader reader = Json.createReader(theReader);
    JsonObject object = reader.readObject();

    JsonValue resourceTypeObj = object.get("resourceType");
    assertObjectOfType(resourceTypeObj, JsonValue.ValueType.STRING, "resourceType");
    String resourceType = ((JsonString) resourceTypeObj).getString();
    if (!"Bundle".equals(resourceType)) {
      throw new DataFormatException("Trying to parse bundle but found resourceType other than 'Bundle'. Found: '" + resourceType + "'");
    }
View Full Code Here

        theState.string(theObject.getString(nextName, null));
        theState.endingElement();
        continue;
      }

      JsonValue nextVal = theObject.get(nextName);
      parseChildren(theState, nextName, nextVal, null);

    }
  }
View Full Code Here

        continue;
      } else if (nextName.charAt(0) == '_') {
        continue;
      }

      JsonValue nextVal = theObject.get(nextName);
      JsonValue alternateVal = theObject.get('_' + nextName);

      parseChildren(theState, nextName, nextVal, alternateVal);

    }
View Full Code Here

    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);
      }
View Full Code Here

          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);
        }
      }
      theState.endingElement();
    }
View Full Code Here

  @Override
  public <T extends IResource> T parseResource(Class<T> theResourceType, Reader theReader) {
    JsonReader reader = Json.createReader(theReader);
    JsonObject object = reader.readObject();

    JsonValue resourceTypeObj = object.get("resourceType");
    assertObjectOfType(resourceTypeObj, JsonValue.ValueType.STRING, "resourceType");
    String resourceType = ((JsonString) resourceTypeObj).getString();

    RuntimeResourceDefinition def;
    if (theResourceType != null) {
View Full Code Here

  @Override
  public TagList parseTagList(Reader theReader) {
    JsonReader reader = Json.createReader(theReader);
    JsonObject object = reader.readObject();

    JsonValue resourceTypeObj = object.get("resourceType");
    assertObjectOfType(resourceTypeObj, JsonValue.ValueType.STRING, "resourceType");
    String resourceType = ((JsonString) resourceTypeObj).getString();

    ParserState<TagList> state = ParserState.getPreTagListInstance(myContext, true);
    state.enteringNewElement(null, resourceType);
View Full Code Here

TOP

Related Classes of javax.json.JsonValue

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.