/** Sets the definition of the ActionScript class to which this node refers. */
  void setClassReference(FlexProject project, IClassDefinition classReference) {
    this.classReference = classReference;

    // TODO Optimize this by enumerating all interfaces one time.

    // Keep track of whether the class implements mx.core.IMXML,
    // because that affects code generation.
    String mxmlObjectInterface = project.getMXMLObjectInterface();
    isMXMLObject = classReference.isInstanceOf(mxmlObjectInterface, project);

    // Keep track of whether the class implements mx.core.IVisualElementContainer,
    // because that affects code generation.
    String visualElementContainerInterface = project.getVisualElementContainerInterface();
    isVisualElementContainer =
        classReference.isInstanceOf(visualElementContainerInterface, project);

    // Keep track of whether the class implements mx.core.IContainer,
    // because that affects code generation.
    String containerInterface = project.getContainerInterface();
    isContainer = classReference.isInstanceOf(containerInterface, project);

    // Keep track of whether the class implements mx.core.IDeferredInstantiationUIComponent
    // because that affects code generation.
    String deferredInstantiationUIComponentInterface =
        project.getDeferredInstantiationUIComponentInterface();
    isDeferredInstantiationUIComponent =
        classReference.isInstanceOf(deferredInstantiationUIComponentInterface, project);
  }