Examples of opt()


Examples of org.codehaus.jettison.json.JSONArray.opt()

                    }
                } else if(jValue instanceof JSONArray){
                    //parse value list
                    JSONArray jValueArray = (JSONArray)jValue;
                    for(int j=0;j<jValueArray.length();j++){
                        jValue = jValueArray.opt(j);
                        if(jValue instanceof JSONObject){
                            //Reconciliation data available!
                            ReconcileValue value = parseValueFromV(jValue, nsPrefixService);
                            if(value != null){
                                values.add(value);
View Full Code Here

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

      final String key = iterator.next();
      try {
        if (SPECIAL_FIELDS.contains(key)) {
          continue;
        }
        final Object value = json.opt(key);
        res.add(new Field(key, namesMap.get(key), typesMap.get("key"), value != JSONObject.NULL ? value : null));
      } catch (final Exception e) {
        throw new JSONException("Error while parsing [" + key + "] field: " + e.getMessage()) {
          @Override
          public Throwable getCause() {
View Full Code Here

Examples of org.json.JSONArray.opt()

    JSONArray allProjects;
    Vector<VOrionProjectStorage> projects = new Vector<VOrionProjectStorage>();
    try {
      allProjects = webWorkspace.getProjectsJSON();
      for(int i=0;i<allProjects.length();i++){
        JSONObject projObj = (JSONObject)allProjects.opt(i);
        String id = projObj.getString("Id");
        WebProject result = WebProject.fromId(id);
        String name = result.getName();
        try {
          projects.add(new VOrionProjectStorage(name, result.getProjectStore(), result, this));
View Full Code Here

Examples of org.json.JSONArray.opt()

            JSONArray jsonActual = (JSONArray)actual;
            if (jsonExpected.length() != jsonActual.length()) {
                return false;
            }
            for (int i = 0; i < jsonExpected.length(); ++i) {
                if (!isJSONEquals(jsonExpected.opt(i), jsonActual.opt(i))) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

Examples of org.json.JSONArray.opt()

    if (acceptsNoChild && children == null)
    {
      return null;
    }

    if (!acceptsNoChild && (children == null || children.length() == 0 || children.opt(0)==null))
    {
      throw new CruxGeneratorException("The widget ["+parentWidgetId+"], declared on View ["+getView().getId()+"], must contain at least one child.");
    }
    return children;
 
View Full Code Here

Examples of org.json.JSONArray.opt()

      return new DynamicConfigProperty(json.toString(), expressions, context);
    } else if (json instanceof JSONArray) {
      JSONArray jsonArray = (JSONArray) json;
      List<Object> values = new ArrayList<Object>(jsonArray.length());
      for (int i = 0, j = jsonArray.length(); i < j; ++i) {
        values.add(jsonToConfig(jsonArray.opt(i), expressions, context));
      }
      return Collections.unmodifiableList(values);
    } else if (json instanceof JSONObject) {
      return jsonToMap((JSONObject) json, expressions, context);
    }
View Full Code Here

Examples of org.json.JSONObject.opt()

      if (probe) {
        log();
      }
      final String name = read(this.namehuff, this.namehuffext,
          this.namekeep);
      if (jsonobject.opt(name) != null) {
        throw new JSONException("Duplicate key.");
      }
      jsonobject.put(
          name,
          !bit() ? read(this.stringhuff, this.stringhuffext,
View Full Code Here

Examples of org.json.JSONObject.opt()

                return false;
            }
            Iterator<?> keys = jsonExpected.keys();
            while (keys.hasNext()) {
                String key = (String)keys.next();
                if (!isJSONEquals(jsonExpected.opt(key), jsonActual.opt(key))) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

Examples of org.json.JSONObject.opt()

            JSONArray jsonActual = (JSONArray)actual;
            if (jsonExpected.length() != jsonActual.length()) {
                return false;
            }
            for (int i = 0; i < jsonExpected.length(); ++i) {
                if (!isJSONEquals(jsonExpected.opt(i), jsonActual.opt(i))) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

Examples of org.json.JSONObject.opt()

    }

    @Override
    public JSONObject getPreviousArticle(final String articleId) throws RepositoryException {
        final JSONObject currentArticle = get(articleId);
        final Date currentArticleCreateDate = (Date) currentArticle.opt(Article.ARTICLE_CREATE_DATE);

        final Query query = new Query().setFilter(CompositeFilterOperator.and(new PropertyFilter(Article.ARTICLE_CREATE_DATE, FilterOperator.LESS_THAN, currentArticleCreateDate), new PropertyFilter(Article.ARTICLE_IS_PUBLISHED, FilterOperator.EQUAL, true))).addSort(Article.ARTICLE_CREATE_DATE, SortDirection.DESCENDING).setCurrentPageNum(1).setPageSize(1).setPageCount(1).addProjection(Article.ARTICLE_TITLE, String.class).addProjection(
            Article.ARTICLE_PERMALINK, String.class);

        final JSONObject result = get(query);
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.