////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package mx.core
{
/**
* The IDeferredInstance interface defines the Flex deferred instance factory interface.
* An implementation of IDeferredInstance creates a particular instance value
* when the getInstance()
method is first called, and returns a reference to that value
* when the getInstance()
method is called subsequently.
*
*
The Flex compiler performs the following automatic coercions when it * encounters MXML that assigns a value to a property with the * IDeferredInstance type:
* *getInstance()
method returns an instance
* of the class, configured as specified in the MXML code.
* The following example shows this format; in this example,
* MyComp is a custom component that has a variable called
* myDeferredInstanceProperty of type IDeferredInstance. The compiler
* generates an IDeferredInstance1 implementation whose
* getInstance()
method returns an instance of the
* Label class, with its text property set to
* "This is a deferred label":
* * <MyComp> * <myDeferredInstanceProperty> * <Label text="This is a deferred label"/> * </myDeferredInstanceProperty> * </MyComp>*
getInstance()
* method returns a new instance of the specified class.
* The specified class must have a constructor with no arguments.
* The following example shows this format; in this example, the compiler
* generates an IDeferredInstance1 implementation whose
* getInstance()
method returns an instance of the
* MyClass class:
* * <MyComp myDeferredInstanceProperty="myPackage.MyClass/>*
Use the IDeferredInstance interface when an ActionScript class defers * the instantiation of a property value. * You cannot use IDeferredInstance if an ActionScript class requires * multiple instances of the same value. * In those situations, use the IFactory interface.
* *The states.AddChild class includes a childFactory
* property that is of type IDeferredInstance.