Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONObject.names()


    if (errorMessagesJsonArray != null) {
      errorMessages.addAll(JsonParseUtil.toStringCollection(errorMessagesJsonArray));
    }
    final JSONObject errorJsonObject = jsonObject.optJSONObject("errors");
    if (errorJsonObject != null) {
      final JSONArray valuesJsonArray = errorJsonObject.toJSONArray(errorJsonObject.names());
      if (valuesJsonArray != null) {
        errorMessages.addAll(JsonParseUtil.toStringCollection(valuesJsonArray));
      }
    }
    return errorMessages;
View Full Code Here


     *            JsonLd object to add the created subject resource.
     */
    private static void parseSubject(JSONObject jo, JsonLdProfile profile, int bnodeCount) throws Exception {
        if (jo.has(JsonLdCommon.CONTEXT)) {
            JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
            for (int i = 0; i < context.names().length(); i++) {
                String name = context.names().getString(i).toLowerCase();
                if (name.equals(JsonLdCommon.TYPES)) {
                    JSONObject typesObject = context.getJSONObject(name);
                    for (int j = 0; j < typesObject.names().length(); j++) {
                        String property = typesObject.names().getString(j);
View Full Code Here

     */
    private static void parseSubject(JSONObject jo, JsonLdProfile profile, int bnodeCount) throws Exception {
        if (jo.has(JsonLdCommon.CONTEXT)) {
            JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
            for (int i = 0; i < context.names().length(); i++) {
                String name = context.names().getString(i).toLowerCase();
                if (name.equals(JsonLdCommon.TYPES)) {
                    JSONObject typesObject = context.getJSONObject(name);
                    for (int j = 0; j < typesObject.names().length(); j++) {
                        String property = typesObject.names().getString(j);

View Full Code Here

            JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
            for (int i = 0; i < context.names().length(); i++) {
                String name = context.names().getString(i).toLowerCase();
                if (name.equals(JsonLdCommon.TYPES)) {
                    JSONObject typesObject = context.getJSONObject(name);
                    for (int j = 0; j < typesObject.names().length(); j++) {
                        String property = typesObject.names().getString(j);

                        Object typeObject = typesObject.get(property);
                        if (typeObject instanceof String) {
                            String typeStr = (String) typeObject;
View Full Code Here

            for (int i = 0; i < context.names().length(); i++) {
                String name = context.names().getString(i).toLowerCase();
                if (name.equals(JsonLdCommon.TYPES)) {
                    JSONObject typesObject = context.getJSONObject(name);
                    for (int j = 0; j < typesObject.names().length(); j++) {
                        String property = typesObject.names().getString(j);

                        Object typeObject = typesObject.get(property);
                        if (typeObject instanceof String) {
                            String typeStr = (String) typeObject;
                            profile.addType(property, typeStr);
View Full Code Here

    JsonLdResource subject = new JsonLdResource();

    try {
      if (jo.has(JsonLdCommon.CONTEXT)) {
        JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
        for (int i = 0; i < context.names().length(); i++) {
          String name = context.names().getString(i).toLowerCase();
          if (name.equals(JsonLdCommon.COERCE)) {
            JSONObject typeObject = context.getJSONObject(name);
            for (int j = 0; j < typeObject.names().length(); j++) {
              String property = typeObject.names().getString(j);
View Full Code Here

    try {
      if (jo.has(JsonLdCommon.CONTEXT)) {
        JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
        for (int i = 0; i < context.names().length(); i++) {
          String name = context.names().getString(i).toLowerCase();
          if (name.equals(JsonLdCommon.COERCE)) {
            JSONObject typeObject = context.getJSONObject(name);
            for (int j = 0; j < typeObject.names().length(); j++) {
              String property = typeObject.names().getString(j);
              String type = typeObject.getString(property);
View Full Code Here

        JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
        for (int i = 0; i < context.names().length(); i++) {
          String name = context.names().getString(i).toLowerCase();
          if (name.equals(JsonLdCommon.COERCE)) {
            JSONObject typeObject = context.getJSONObject(name);
            for (int j = 0; j < typeObject.names().length(); j++) {
              String property = typeObject.names().getString(j);
              String type = typeObject.getString(property);
              subject.putPropertyType(property, type);
            }
          } else {
View Full Code Here

        for (int i = 0; i < context.names().length(); i++) {
          String name = context.names().getString(i).toLowerCase();
          if (name.equals(JsonLdCommon.COERCE)) {
            JSONObject typeObject = context.getJSONObject(name);
            for (int j = 0; j < typeObject.names().length(); j++) {
              String property = typeObject.names().getString(j);
              String type = typeObject.getString(property);
              subject.putPropertyType(property, type);
            }
          } else {
            jld.addNamespacePrefix(context.getString(name), name);
View Full Code Here

      errorMessages = Collections.emptyList();
    }

    final Map<String, String> errors;
    if (jsonErrors != null && jsonErrors.length() > 0) {
      errors = JsonParseUtil.toStringMap(jsonErrors.names(), jsonErrors);
    } else {
      errors = Collections.emptyMap();
    }
    return new ErrorCollection(status, errorMessages, errors);
  }
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.