Packagecom.soma.assets
Classpublic class ClassImport

Author: Romuald Quantin - www.soundstep.com

Information:
Blog page - SomaUI
How does it work - Soma Protest
Project Host - Google Code
Documentation - Soma ASDOC
Class version: 2.0
Actionscript version: 3.0

Copyright:

The contents of this file are subject to the Mozilla Public License
Version 1.1 (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.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and
limitations under the License.

The Original Code is Soma.
The Initial Developer of the Original Code is Romuald Quantin.
Initial Developer are Copyright (C) 2008-2009 Soundstep. All Rights Reserved.

Usage:
Classes that don't have an explicit reference in the code are not imported by the compiler.
The ClassImport class allow you to register a class and force its import. It is useful for classes instantiated from a String, such as the page classes (type attribute in a page of the XML Site definition), loading classes and menu classes.
A global ClassImport instance is created in Soma and accessed through 2 methods getClass and registerClass.

  Soma.getInstance().registerClass(MyClass);
  trace(Soma.getInstance().getClass("MyClass"));
  



Public Methods
 MethodDefined by
  
Creates a ClassImport instance.
ClassImport
  
getClass(className:String):Class
Get a Class imported from its name.
ClassImport
  
register(value:Class):String
Register a class to force its import in the compiler and be able to create instance from a String (getDefinitionByName).
ClassImport
Constructor detail
ClassImport()constructor
public function ClassImport()

Creates a ClassImport instance.

Method detail
getClass()method
public function getClass(className:String):Class

Get a Class imported from its name.

Parameters
className:String — String of the name of the Class.

Returns
Class — a Class.
register()method 
public function register(value:Class):String

Register a class to force its import in the compiler and be able to create instance from a String (getDefinitionByName).

Parameters
value:Class — Class to import

Returns
String