API DocumentationAll Packages | All Classes | Index | Frames
DynamicState
 
Packageweavejs.api.core
Classpublic class DynamicState
InheritanceDynamicState Inheritance Object

Dynamic state objects have three properties: objectName, className, sessionState



Public Methods
 MethodDefined By
  
alterSessionStateToBypassDiff(object:Object):void
[static] Alters a session state object to bypass special diff logic for dynamic state arrays.
DynamicState
  
create(objectName:String = null, className:String = null, sessionState:Object = null):Object
[static] Creates an Object having three properties: objectName, className, sessionState
DynamicState
  
isDynamicState(object:Object, handleBypassDiff:Boolean = false):Boolean
[static] This function can be used to detect dynamic state objects within nested, untyped session state objects.
DynamicState
  
isDynamicStateArray(state:*, handleBypassDiff:Boolean = false):Boolean
[static] This function checks whether or not a session state is an Array containing at least one object that looks like a DynamicState and has no other non-String items.
DynamicState
  
removeTypeFromState(state:Object, recursive:Boolean = true):Object
[static] Converts DynamicState Arrays into Objects.
DynamicState
  
traverseState(state:Object, path:Array, newValue:*):*
[static] Sets or gets a value in a session state.
DynamicState
Public Constants
 ConstantDefined By
  BYPASS_DIFF : String = bypassDiff
[static] The name of the property used to make isDynamicState() return false in order to bypass special diff logic for dynamic state arrays.
DynamicState
  CLASS_NAME : String = className
[static] The name of the property containing the qualified class name of the original object providing the session state.
DynamicState
  OBJECT_NAME : String = objectName
[static] The name of the property containing the name assigned to the object when the session state is generated.
DynamicState
  SESSION_STATE : String = sessionState
[static] The name of the property containing the session state for an object of the type specified by className.
DynamicState
Method Detail
alterSessionStateToBypassDiff()method
public static function alterSessionStateToBypassDiff(object:Object):void

Alters a session state object to bypass special diff logic for dynamic state arrays. It does so by adding the "bypassDiff" property to any part for which isDynamicState(part) returns true.

Parameters

object:Object

create()method 
public static function create(objectName:String = null, className:String = null, sessionState:Object = null):Object

Creates an Object having three properties: objectName, className, sessionState

Parameters

objectName:String (default = null) — The name assigned to the object when the session state is generated.
 
className:String (default = null) — The qualified class name of the original object providing the session state.
 
sessionState:Object (default = null) — The session state for an object of the type specified by className.

Returns
Object
isDynamicState()method 
public static function isDynamicState(object:Object, handleBypassDiff:Boolean = false):Boolean

This function can be used to detect dynamic state objects within nested, untyped session state objects. This function will check if the given object has the three properties of a dynamic state object.

Parameters

object:Object — An object to check.
 
handleBypassDiff:Boolean (default = false) — Set this to true to allow the object to contain the optional bypassDiff property.

Returns
Boolean — true if the object has all three properties and no extras (except for "bypassDiff" when the handleBypassDiff parameter is set to true).
isDynamicStateArray()method 
public static function isDynamicStateArray(state:*, handleBypassDiff:Boolean = false):Boolean

This function checks whether or not a session state is an Array containing at least one object that looks like a DynamicState and has no other non-String items.

Parameters

state:* — A session state object.
 
handleBypassDiff:Boolean (default = false) — Set this to true to allow dynamic state objects to contain the optional bypassDiff property.

Returns
Boolean — A value of true if the Array looks like a dynamic session state or diff.
removeTypeFromState()method 
public static function removeTypeFromState(state:Object, recursive:Boolean = true):Object

Converts DynamicState Arrays into Objects.

Parameters

state:Object — The state to convert
 
recursive:Boolean (default = true) — Specifies whether or not to recursively remove types. If this is set to false, this function will only have an effect if the given state is a DynamicState Array.

Returns
Object — The converted state
traverseState()method 
public static function traverseState(state:Object, path:Array, newValue:*):*

Sets or gets a value in a session state.

Parameters

state:Object — The state to traverse
 
path:Array — The path in the state to traverse
 
newValue:* (default = NaN) — The new value, or undefined to retrieve the current value

Returns
* — The new or existing value
Constant Detail
BYPASS_DIFFConstant
public static const BYPASS_DIFF:String = bypassDiff

The name of the property used to make isDynamicState() return false in order to bypass special diff logic for dynamic state arrays.

CLASS_NAMEConstant 
public static const CLASS_NAME:String = className

The name of the property containing the qualified class name of the original object providing the session state.

OBJECT_NAMEConstant 
public static const OBJECT_NAME:String = objectName

The name of the property containing the name assigned to the object when the session state is generated.

SESSION_STATEConstant 
public static const SESSION_STATE:String = sessionState

The name of the property containing the session state for an object of the type specified by className.