private void fillIn ( ) throws IOException { BufferedReader br = null ; InputStream in = null ; try { in = new FileInputStream ( this . definitionFile . getEditedFile ( ) ) ; br = new BufferedReader ( new InputStreamReader ( in , StandardCharsets . UTF_8 ) ) ; String line ; while ( ( line = nextLine ( br ) ) != null ) { int code = recognizeBlankLine ( line , this . definitionFile . getBlocks ( ) ) ; if ( code == P_CODE_YES ) continue ; code = recognizeComment ( line , this . definitionFile . getBlocks ( ) ) ; if ( code == P_CODE_YES ) continue ; code = recognizeImport ( line ) ; if ( code == P_CODE_CANCEL ) break ; else if ( code == P_CODE_YES ) continue ; code = recognizeFacet ( line , br ) ; if ( code == P_CODE_CANCEL ) break ; else if ( code == P_CODE_YES ) continue ; code = recognizeInstanceOf ( line , br , null ) ; if ( code == P_CODE_CANCEL ) break ; else if ( code == P_CODE_YES ) continue ; // "recognizeComponent" is the last attempt to identify the line. code = recognizeComponent ( line , br ) ; // So, eventually, we add the line as an unknown block. if ( code != P_CODE_YES ) this . definitionFile . getBlocks ( ) . add ( new BlockUnknown ( this . definitionFile , line ) ) ; // Deal with the error codes. // Cancel: break the loop. // No: try to process the next line. if ( code == P_CODE_CANCEL ) break ; if ( code == P_CODE_NO ) addModelError ( ErrorCode . P_UNRECOGNIZED_BLOCK ) ; } if ( line == null && this . lastLineEndedWithLineBreak ) this . definitionFile . getBlocks ( ) . add ( new BlockBlank ( this . definitionFile , "" ) ) ; } finally { Utils . closeQuietly ( br ) ; Utils . closeQuietly ( in ) ; } }
Parses the file and fills - in the resulting structure .