Packageorg.orpheus.xml.bind.helpers
Classpublic class TypeRegistry

Maintains a mapping of qualified names to class definitions for lookup during marshalling and unmarshalling.

Author: Andrew Lewisohn
Version: $Revision: 30 $, $Date: 2009-02-12 16:43:08 -0500 (Thu, 12 Feb 2009) $, $Author: alewisohn $
Since: 0.1



Public Methods
 MethodDefined by
  
getClass(type:Object):Class
Looks for a registered Class for the given type.
TypeRegistry
  
getCollectionClass(type:Object):Class
Returns the Class for the collection type represented by the given Qname or String.
TypeRegistry
  
[static] Returns the sole instance of this singleton class, creating it if it does not already exist.
TypeRegistry
  
registerClass(type:Object, definition:Object):void
Maps a type QName to a Class definition.
TypeRegistry
  
registerCollectionClass(type:Object, definition:Object):void
Maps a type name to a collection Class.
TypeRegistry
  
unregisterClass(type:Object):void
Removes a Class from the registry for the given type.
TypeRegistry
  
unregisterCollectionClass(type:Object):void
Removes a collection Class from the registry for the given type.
TypeRegistry
Method detail
getClass()method
public function getClass(type:Object):Class

Looks for a registered Class for the given type.

Parameters
type:Object — The QName or String representing the type name.

Returns
Class — Returns the Class for the given type, or null of the type has not been registered.
getCollectionClass()method 
public function getCollectionClass(type:Object):Class

Returns the Class for the collection type represented by the given Qname or String.

Parameters
type:Object — The QName or String representing the collection type name.

Returns
Class — Returns the Class for the collection type represented by the given Qname or String.
getInstance()method 
public static function getInstance():TypeRegistry

Returns the sole instance of this singleton class, creating it if it does not already exist.

Returns
TypeRegistry — Returns the sole instance of this singleton class, creating it if it does not already exist.
registerClass()method 
public function registerClass(type:Object, definition:Object):void

Maps a type QName to a Class definition. The definition can be a String representation of the fully qualified class name or an instance of the Class itself.

Parameters
type:Object — The QName or String representation of the type name.
 
definition:Object — The Class itself or class name as a String.
registerCollectionClass()method 
public function registerCollectionClass(type:Object, definition:Object):void

Maps a type name to a collection Class. A collection is either the top level Array type, or an implementation of mx.collections.IList. The definition can be a String representation of the fully qualified class name or an instance of the Class itself.

Parameters
type:Object — The QName or String representation of the type name.
 
definition:Object — The Class itself or class name as a String.
unregisterClass()method 
public function unregisterClass(type:Object):void

Removes a Class from the registry for the given type.

Parameters
type:Object — The QName or String representation of the type name.
unregisterCollectionClass()method 
public function unregisterCollectionClass(type:Object):void

Removes a collection Class from the registry for the given type.

Parameters
type:Object — The QName or String representation of the collection type name.