Code example for JSONObject

Methods: has, isNull

0
    final public int                columnCount;
    final public List<ColumnInfo>   columns = new ArrayList<ColumnInfo>();
     
    public FreebaseDataExtensionJob(JSONObject obj) throws JSONException {
        this.extension = obj;
        this.columnCount = (obj.has("properties") && !obj.isNull("properties")) ?
                countColumns(obj.getJSONArray("properties"), columns, new ArrayList<String>(), new ArrayList<String>()) : 0;
    } 
     
    public Map<String, FreebaseDataExtensionJob.DataExtension> extend(
        Set<String> ids,
        Map<String, ReconCandidate> reconCandidateMap
    ) throws Exception { 
        StringWriter writer = new StringWriter();
        formulateQuery(ids, extension, writer);
        String query = writer.toString();
         
        String result = FreebaseUtils.mqlread(query);
         
        JSONObject o = ParsingUtilities.evaluateJsonStringToObject(result);
        Map<String, FreebaseDataExtensionJob.DataExtension> map = new HashMap<String, FreebaseDataExtensionJob.DataExtension>();