示例#1
0
 /**
  * 得到多根JSON数组对象
  *
  * @return
  * @throws ImetaFormException
  */
 @SuppressWarnings("unchecked")
 public JSONArray getFormJa() throws BIJSONException {
   if (this.content != null && this.content.size() > 0) {
     JSONArray rtn = new JSONArray();
     for (ComponentMetaInterface meta : this.content) {
       rtn.add(meta.getFormJo());
     }
     return rtn;
   }
   return null;
 }
示例#2
0
 /**
  * 得到单根JSON对象
  *
  * @return
  * @throws ImetaFormException
  */
 @SuppressWarnings("unchecked")
 @Override
 public JSONObject getFormJo() throws BIJSONException {
   JSONObject formJo = super.getFormJo();
   if (this.content != null && this.content.size() > 0) {
     JSONArray sub = new JSONArray();
     for (ComponentMetaInterface dataMeta : this.content) {
       if (dataMeta != null) {
         if (dataMeta instanceof ComplexComponentMeta) {
           if (((ComplexComponentMeta) dataMeta).isMultiRoot()) {
             sub.addAll(((ComplexComponentMeta) dataMeta).getFormJa());
           } else {
             sub.add(dataMeta.getFormJo());
           }
         } else {
           sub.add(dataMeta.getFormJo());
         }
       }
     }
     formJo.put(HTML.TAG_CONTENT, sub);
   }
   return formJo;
 }