com.smartgwt.client.util

## Class ObjectFactory

- java.lang.Object
- - com.smartgwt.client.util.ObjectFactory

-     public final class ObjectFactory
      extends java.lang.Object

  This class contains static utility methods to map between SmartClient objects/types and Smart GWT objects/classes.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T extends BaseClass> T` | `createBaseClass(java.lang.String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault)`
    `static <T extends BaseWidget> T` | `createCanvas(java.lang.String smartClientClassName, JavaScriptObject javaScriptObject)` This method will create a Smart GWT object from the provided javaScriptObject and smartClientClassName.
    `static <T extends DataClass> T` | `createDataClass(java.lang.String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault)`
    `static <T extends RefDataClass> T` | `createFormItem(java.lang.String smartClientClassName, JavaScriptObject javaScriptObject)` This method will create a SmartGWT class from the javaScriptObject and smartClientClassName provided.
    `static java.lang.Object` | `createInstance(java.lang.String scClassName, JavaScriptObject jsObj)`
    `static java.lang.Class<?>` | `getSmartGWTClass(java.lang.String smartClientClassName)` This method is a convenience for calling @{link #getSmartGWTClass}.getName();
    `static java.lang.String` | `getSmartGWTClassFQN(java.lang.String smartClientClassName)` The SmartClient class name used to lookup the corresponding SmartGWT class, which is then returned.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### createCanvas

          public static final <T extends BaseWidget> T createCanvas(java.lang.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:

    - #### createFormItem

          public static final <T extends RefDataClass> T createFormItem(java.lang.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:

    - #### createDataClass

          public static <T extends DataClass> T createDataClass(java.lang.String smartClientClassName,
                                                JavaScriptObject javaScriptObject,
                                                boolean createDefault)

    - #### createBaseClass

          public static <T extends BaseClass> T createBaseClass(java.lang.String smartClientClassName,
                                                JavaScriptObject javaScriptObject,
                                                boolean createDefault)

    - #### createInstance

          public static java.lang.Object createInstance(java.lang.String scClassName,
                                        JavaScriptObject jsObj)

    - #### getSmartGWTClassFQN

          public static final java.lang.String getSmartGWTClassFQN(java.lang.String smartClientClassName)

      The 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

    - #### getSmartGWTClass

          public static final java.lang.Class<?> getSmartGWTClass(java.lang.String smartClientClassName)

      This method is a convenience for calling @{link #getSmartGWTClass}.getName();
      Parameters:
        `smartClientClassName` -
      Returns:
        SmartGWT class fully qualified name or null