1 package org.sapia.soto.util; 2 3 import org.sapia.util.xml.confix.CompositeObjectFactory; 4 import org.sapia.util.xml.confix.ConfigurationException; 5 6 import java.util.List ; 7 8 9 23 public class SotoObjectFactory extends CompositeObjectFactory { 24 27 public SotoObjectFactory() { 28 super.setMapToPrefix(true); 29 } 30 31 public void registerDefs(Namespace defs) throws ConfigurationException { 32 DefObjectFactory fac; 33 34 if (super.containsObjectFactory(defs.getPrefix())) { 35 fac = (DefObjectFactory) super.getFactoryFor(defs.getPrefix()); 36 } else { 37 super.registerFactory(defs.getPrefix(), fac = new DefObjectFactory()); 38 } 39 40 Def def; 41 List lst = defs.getDefs(); 42 43 for (int i = 0; i < lst.size(); i++) { 44 def = (Def) lst.get(i); 45 fac.addDef(def); 46 } 47 } 48 } 49 | Popular Tags |