protected ParserResults processSpec ( final ParserData parserData , final ParsingMode mode , final boolean processProcesses ) { // Find the first line that isn't a blank line or a comment while ( parserData . getLines ( ) . peek ( ) != null ) { final String input = parserData . getLines ( ) . peek ( ) ; if ( isCommentLine ( input ) || isBlankLine ( input ) ) { parserData . setLineCount ( parserData . getLineCount ( ) + 1 ) ; if ( isCommentLine ( input ) ) { parserData . getContentSpec ( ) . appendComment ( input ) ; } else if ( isBlankLine ( input ) ) { parserData . getContentSpec ( ) . appendChild ( new TextNode ( "\n" ) ) ; } parserData . getLines ( ) . poll ( ) ; continue ; } else { // We've found the first line so break the loop break ; } } // Process the content spec depending on the mode if ( mode == ParsingMode . NEW ) { return processNewSpec ( parserData , processProcesses ) ; } else if ( mode == ParsingMode . EDITED ) { return processEditedSpec ( parserData , processProcesses ) ; } else { return processEitherSpec ( parserData , processProcesses ) ; } }
Starting method to process a Content Specification string into a ContentSpec object .