src/main/java/com/github/jreddit/parser/single/FullSubmissionParser.java
public FullSubmission parse(String jsonText) throws RedditParseException {
        
        try {
        
            // Parse JSON text
            Object response = JSON_PARSER.parse(jsonText);
        
            // Validate response
            validate(response);
    
            // Create submission (casting with JSON is horrible)
            JSONObject main = (JSONObject) ((JSONArray) response).get(0);
            Submission submission = new Submission((JSONObject) ((JSONObject) ((JSONArray)((JSONObject) main.get("data")).get("children")).get(0)).get("data"));
             
            // Create comment tree
            JSONObject mainTree =  (JSONObject) ((JSONArray) response).get(1);
            List<CommentTreeElement> commentTree = parseRecursive(mainTree);
            
            // Return the set of submission and its comment tree
            return new FullSubmission(submission,  commentTree);
        
        } catch (ParseException pe) {
            throw new RedditParseException(pe);
        }
        
    }
public FullSubmission parse(String jsonText) throws RedditParseException {
        
        try {
        
            // Parse JSON text
            Object response = JSON_PARSER.parse(jsonText);
        
            // Validate response
            validate(response);
    
            // Create submission (casting with JSON is horrible)
            JSONObject main = (JSONObject) ((JSONArray) response).get(0);
            Submission submission = new Submission((JSONObject) ((JSONObject) ((JSONArray)((JSONObject) main.get("data")).get("children")).get(0)).get("data"));
             
            // Create comment tree
            JSONObject mainTree =  (JSONObject) ((JSONArray) response).get(1);
            List<CommentTreeElement> commentTree = parseRecursive(mainTree);
            
            // Return the set of submission and its comment tree
            return new FullSubmission(submission,  commentTree);
        
        } catch (ParseException pe) {
            throw new RedditParseException(pe);
        }
        
    }
public FullSubmission parse ( String jsonText ) throws RedditParseException { try { // Parse JSON text Object response = JSON_PARSER . parse ( jsonText ) ; // Validate response validate ( response ) ; // Create submission (casting with JSON is horrible) JSONObject main = ( JSONObject ) ( ( JSONArray ) response ) . get ( 0 ) ; Submission submission = new Submission ( ( JSONObject ) ( ( JSONObject ) ( ( JSONArray ) ( ( JSONObject ) main . get ( "data" ) ) . get ( "children" ) ) . get ( 0 ) ) . get ( "data" ) ) ; // Create comment tree JSONObject mainTree = ( JSONObject ) ( ( JSONArray ) response ) . get ( 1 ) ; List < CommentTreeElement > commentTree = parseRecursive ( mainTree ) ; // Return the set of submission and its comment tree return new FullSubmission ( submission , commentTree ) ; } catch ( ParseException pe ) { throw new RedditParseException ( pe ) ; } }
Parse JSON received from reddit into a full submission.
A full submissions means it has both (a) the submission, and (b) the comment tree.

@param jsonText JSON Text
@return Full submission

@throws ParseException
Parse JSON received from reddit into a full submission . A full submissions means it has both ( a ) the submission and ( b ) the comment tree .