Factory Methods

The methods listed in the table Factory Methods are available in the factory that is available for each BOM package.

Factory Methods

Method Return Value Description
create<bom-classname>([json | object]) 
An instance of the given class If no argument is provided to the method, a new object of the given type is returned. You can provide an optional argument that provides either a JSON string representation of an object of the given type, or a JavaScript object containing the same data. If you provide a wrong type of JSON or an array, the method throws a runtime exception.
listCreate<bom-classname>([json | object])   
     
An array instance that contains objects of the given class If no argument is provided to the method, an empty array is returned. If you provide a JSON specification for a single object, the method returns that object wrapped in an array. You can provide an optional argument that provides either:
a JSON String representation of an object of the given type
a JavaScript object containing the same data
a JSON String representation of an array of objects of the given type
a JavaScript array of objects representing the JSON data

If you provide a wrong type of JSON, the method throws a runtime exception.

create(className)

className is a fully-qualified name of the BOM JavaScript class. This must be a class managed by the given factory.

Object Creates an instance of the given class. ControlWrapper uses this method to support cases where the type of object being managed by a complex custom control is not known at design time. From form action methods, the specific createXXX() method for a given class should be used.
getClass(className)

className is a fully-qualified name of the BOM JavaScript class. This must be a class managed by the given factory.

Object Returns the class object for the class with the given name.