1 9 package org.openuss.presentation.enhydra.framework.designer; 10 11 import com.lutris.appserver.server.httpPresentation.*; 12 13 import java.lang.reflect.*; 14 15 import java.util.*; 16 17 import org.enhydra.xml.xmlc.html.*; 18 19 20 26 public class PageDesignerFactory { 27 private static String DESIGN_SUFFIX = "Designer"; 29 30 33 public static void design(Object page, String fullClassName, Object po) 34 throws Exception { 35 String designFullClassName = new String (fullClassName.concat( 41 DESIGN_SUFFIX)); 42 43 Class objectClass = Class.forName(designFullClassName); 45 46 Class myPage = Class.forName("java.lang.Object"); 48 Class myPo = Class.forName("java.lang.Object"); 49 Class [] parameterTypes = new Class [2]; 50 parameterTypes[0] = myPage; 51 parameterTypes[1] = myPo; 52 53 Constructor objectConstructor = objectClass.getConstructor( 54 parameterTypes); 55 56 Object [] initArgs = new Object [2]; 58 initArgs[0] = page; 59 initArgs[1] = po; 60 61 BasePageDesigner designer = (BasePageDesigner) objectConstructor.newInstance( 62 initArgs); 63 64 try { 66 designer.designPage(); 67 } catch (Exception ex) { 68 System.out.println("Error on design the page: " + designer + 70 " - " + ex); 71 } 72 } 73 } | Popular Tags |