1 15 package org.apache.tapestry.engine.state; 16 17 import org.apache.hivemind.ApplicationRuntimeException; 18 import org.apache.hivemind.impl.BaseLocatable; 19 20 26 public class InstantiateClassStateObjectFactory extends BaseLocatable implements StateObjectFactory 27 { 28 private Class _objectClass; 29 30 public Object createStateObject() 31 { 32 try 33 { 34 return _objectClass.newInstance(); 35 } 36 catch (Exception ex) 37 { 38 throw new ApplicationRuntimeException(StateMessages.unableToInstantiateObject( 39 _objectClass, 40 ex), getLocation(), ex); 41 } 42 } 43 44 public void setObjectClass(Class objectClass) 45 { 46 _objectClass = objectClass; 47 } 48 } | Popular Tags |