Packageorg.openPyro.core
Classpublic class ClassFactory

A ClassFactory instance is a "factory object" which can be used to generate instances of another class, each with identical properties.



Public Properties
 PropertyDefined by
  generator : Class
The Class that the newInstance() method uses to generate objects from this factory object.
ClassFactory
  properties : Object = null
An Object whose name/value pairs specify the properties to be set on each object generated by the newInstance() method.
ClassFactory
Public Methods
 MethodDefined by
  
ClassFactory(generator:Class = null)
Constructor.
ClassFactory
  
Creates a new instance of the generator class, with the properties specified by properties.
ClassFactory
Property detail
generatorproperty
public var generator:Class

The Class that the newInstance() method uses to generate objects from this factory object.

propertiesproperty 
public var properties:Object = null

An Object whose name/value pairs specify the properties to be set on each object generated by the newInstance() method.

For example, if you set properties to { text: "Hello", width: 100 }, then every instance of the generator class that is generated by calling newInstance() will have its text set to "Hello" and its width set to 100.

The default value is null.

Constructor detail
ClassFactory()constructor
public function ClassFactory(generator:Class = null)

Constructor.

Parameters
generator:Class (default = null) — The Class that the newInstance() method uses to generate objects from this factory object.
Method detail
newInstance()method
public function newInstance():*

Creates a new instance of the generator class, with the properties specified by properties.

This method implements the newInstance() method of the IFactory interface.

Returns
* — The new instance that was created.