1 4 package org.oddjob.designer.factory; 5 6 import org.apache.log4j.Logger; 7 import org.oddjob.arooa.ArooaException; 8 import org.oddjob.arooa.ObjectFactory; 9 import org.oddjob.designer.model.DesignComponent; 10 import org.oddjob.designer.model.DesignElementType; 11 12 15 public class DesignFactory { 16 public static Logger logger = Logger.getLogger(DesignFactory.class); 17 18 public static final String UNKNOWN_TAG = "other"; 19 20 private static DesignFactoryBean instance ; 21 22 private static DesignFactoryBean getInstance() { 23 if (instance == null) { 24 instance = new DesignFactoryBean( 25 DesignFactory.class.getResourceAsStream("factory.xml")); 26 } 27 return instance; 28 } 29 30 39 public static SimpleHierarchy childActions(final Object subject, final String element) { 40 return getInstance().childActions(subject, element); 41 } 42 43 51 public static DesignComponent createComponent(String name) throws ArooaException { 52 return getInstance().createComponent(name); 53 } 54 55 60 public static ObjectFactory componentFactory() { 61 return getInstance().componentFactory(); 62 } 63 64 70 public static String [] supportedTypes(Class type) { 71 return getInstance().supportedTypes(type); 72 } 73 74 82 public static DesignElementType createType(String name) throws ArooaException { 83 return getInstance().createType(name); 84 } 85 86 public static ObjectFactory valueFactory() { 87 return getInstance().valueFactory(); 88 } 89 90 } 91 | Popular Tags |