Packagecom.pblabs.engine.serialization
Classpublic class Enumerable
InheritanceEnumerable Inheritance Object
Implements ISerializable
Subclasses AnimatorType, InputKey, SceneAlignment

Base class that implements common functionality for enumeration classes. An enumeration class is essentially a class that is just a list of constant values. They can be used to add type safety to properties that need to be limited to a specific subset of values.

Serialization is also provided by this class so the names of the constants can be used in XML rather than their values.



Public Properties
 PropertyDefined By
  defaultType : Enumerable
[read-only] This must be implemented by subclasses.
Enumerable
  typeMap : Dictionary
[read-only] This must be implemented by subclasses.
Enumerable
Public Methods
 MethodDefined By
  
deserialize(xml:XML):*
deserializes the object from xml.
Enumerable
  
serialize(xml:XML):void
serializes the object to XML.
Enumerable
Property Detail
defaultTypeproperty
defaultType:Enumerable  [read-only]

This must be implemented by subclasses. It is the type to use when a string isn't found in the TypeMap.


Implementation
    public function get defaultType():Enumerable
typeMapproperty 
typeMap:Dictionary  [read-only]

This must be implemented by subclasses. It is a dictionary that maps the names of enumerable values to the instance of the enumerable they represent.


Implementation
    public function get typeMap():Dictionary
Method Detail
deserialize()method
public function deserialize(xml:XML):*

deserializes the object from xml. The format of the xml passed is custom, depending on the way the object was serialized with the serialize method.

Parameters

xml:XML — The xml containing the serialized definition of the class.

Returns
* — The deserialized object. Usually 'this' should be returned, but in some cases it may be useful to return something else. The Enumerable class does this to force all values to be a member of the enumeration.
serialize()method 
public function serialize(xml:XML):void

serializes the object to XML. This should not include the main tag defining the class itself.

Parameters

xml:XML — The xml object to which the serialization of this class should be added. This xml object is a single tag containing the main class definition, so only children of this class should be added to it.