import com.steptools.stdev.*; import com.steptools.stdev.p21.*; import com.steptools.schemas.config_control_design.*; import java.util.Iterator; import java.io.IOException; class ProductDump { static void dumpProduct(Product prod) { System.out.println ("Product info:"); System.out.println (" id: "+prod.getId()); System.out.println (" name: "+prod.getName()); String description = prod.getDescription(); System.out.println (" description: " +(description==null ? "" : description)); SetProduct_context ctxs = prod.getFrame_of_reference(); Iterator it = ctxs.iterator(); while (it.hasNext()) { Product_context cx = (Product_context) it.next(); System.out.println (" context: "+cx.getName()); } System.out.println(); } static void dumpProducts(String file) throws STDevException, IOException{ System.out.println ("Processing file: "+file); Model mod; Part21Parser parser = new Part21Parser(); mod = parser.parse(file); Population pop = (Population) mod.getPopulation(); EntityExtent prods = pop.getFolder(Product.DOMAIN); Iterator itor = prods.iterator(); while (itor.hasNext()) { Product p = (Product) itor.next(); dumpProduct(p); } } public static void main(String[] argv) throws STDevException, IOException{ dumpProducts(argv[0]); } }