Package com.smartgwt.client.util
Class ObjectFactory
java.lang.Object
com.smartgwt.client.util.ObjectFactory
This class contains static utility methods to map between SmartClient objects/types and Smart GWT objects/classes.
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T extends BaseClass>
 TcreateBaseClass(String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault) static final <T extends BaseWidget>
 TcreateCanvas(String smartClientClassName, JavaScriptObject javaScriptObject) This method will create a Smart GWT object from the provided javaScriptObject and smartClientClassName.static <T extends DataClass>
 TcreateDataClass(String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault) static final <T extends RefDataClass>
 TcreateFormItem(String smartClientClassName, JavaScriptObject javaScriptObject) This method will create a SmartGWT class from the javaScriptObject and smartClientClassName provided.static ObjectcreateInstance(String scClassName, JavaScriptObject jsObj) static final Class<?>getSmartGWTClass(String smartClientClassName) This method is a convenience for calling @{link #getSmartGWTClass}.getName();static final StringgetSmartGWTClassFQN(String smartClientClassName) The SmartClient class name used to lookup the corresponding SmartGWT class, which is then returned.
- 
Method Details- 
createCanvaspublic static final <T extends BaseWidget> T createCanvas(String smartClientClassName, JavaScriptObject javaScriptObject) This method will create a Smart GWT object from the provided javaScriptObject and smartClientClassName. It is possible that null will be returned.- Returns:
 
- 
createFormItempublic static final <T extends RefDataClass> T createFormItem(String smartClientClassName, JavaScriptObject javaScriptObject) This method will create a SmartGWT class from the javaScriptObject and smartClientClassName provided. It is possible that null will be returned.- Returns:
 
- 
createDataClasspublic static <T extends DataClass> T createDataClass(String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault) 
- 
createBaseClasspublic static <T extends BaseClass> T createBaseClass(String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault) 
- 
createInstance
- 
getSmartGWTClassFQNThe SmartClient class name used to lookup the corresponding SmartGWT class, which is then returned. Because this method is generic you can return whatever type you'are expecting. So it is completely appropriate to do the following, as no casting is necessary.Button myButton = ObjectRegistry.getSmartGWTClass("Button");- Parameters:
- smartClientClassName-
- Returns:
- SmartGWT class or null
 
- 
getSmartGWTClassThis method is a convenience for calling @{link #getSmartGWTClass}.getName();- Parameters:
- smartClientClassName-
- Returns:
- SmartGWT class fully qualified name or null
 
 
-