@Test public void testComplexInstances() throws Exception { File f = TestUtils.findTestFile( "/configurations/valid/complex-instances.instances" ); FileDefinition def = ParsingModelIo.readConfigurationFile( f, true ); Assert.assertEquals( 0, def.getParsingErrors().size()); List<AbstractBlock> toProcess = new ArrayList<> (); toProcess.addAll( def.getBlocks()); List<BlockInstanceOf> instances = new ArrayList<> (); while( ! toProcess.isEmpty()) { AbstractBlock currentBlock = toProcess.remove( 0 ); if( currentBlock.getInstructionType() == AbstractBlock.INSTANCEOF ) { BlockInstanceOf blockInstanceOf = (BlockInstanceOf) currentBlock; instances.add( blockInstanceOf ); toProcess.addAll( blockInstanceOf.getInnerBlocks()); } } Assert.assertEquals( 8, instances.size()); }
public static FileDefinition readConfigurationFile( File relationsFile, boolean ignoreComments ) { FileDefinitionParser parser = new FileDefinitionParser( relationsFile, ignoreComments ); return parser.read(); }
ParsingModelIo { public static FileDefinition readConfigurationFile( File relationsFile, boolean ignoreComments ) { FileDefinitionParser parser = new FileDefinitionParser( relationsFile, ignoreComments ); return parser.read(); } }
ParsingModelIo { public static FileDefinition readConfigurationFile( File relationsFile, boolean ignoreComments ) { FileDefinitionParser parser = new FileDefinitionParser( relationsFile, ignoreComments ); return parser.read(); } private  ParsingModelIo(); }
ParsingModelIo { public static FileDefinition readConfigurationFile( File relationsFile, boolean ignoreComments ) { FileDefinitionParser parser = new FileDefinitionParser( relationsFile, ignoreComments ); return parser.read(); } private  ParsingModelIo(); static FileDefinition readConfigurationFile( File relationsFile, boolean ignoreComments ); static String writeConfigurationFile( FileDefinition relationsFile, boolean writeComments, String lineSeparator ); static void saveRelationsFile( FileDefinition relationsFile, boolean writeComments, String lineSeparator ); static void saveRelationsFileInto(
			File targetFile,
			FileDefinition relationsFile,
			boolean writeComments,
			String lineSeparator ); }
ParsingModelIo { public static FileDefinition readConfigurationFile( File relationsFile, boolean ignoreComments ) { FileDefinitionParser parser = new FileDefinitionParser( relationsFile, ignoreComments ); return parser.read(); } private  ParsingModelIo(); static FileDefinition readConfigurationFile( File relationsFile, boolean ignoreComments ); static String writeConfigurationFile( FileDefinition relationsFile, boolean writeComments, String lineSeparator ); static void saveRelationsFile( FileDefinition relationsFile, boolean writeComments, String lineSeparator ); static void saveRelationsFileInto(
			File targetFile,
			FileDefinition relationsFile,
			boolean writeComments,
			String lineSeparator );  }