Packagevegas.string
Classpublic dynamic class Expression
InheritanceExpression Inheritance flash.utils.Dictionary
SubclassesTypeExpression

This dictionary register formattable expression and format a String with all expression in the dictionnary.
     import vegas.string.Expression ;
     
     var source:String ;
     
     var exp:Expression      = new Expression() ;
     
     exp["root"]              = "c:" ;
     exp["system"]            = "{root}/project/system" ;
     exp["data.maps"]         = "{system}/data/maps" ;
     exp["data.maps.HashMap"] = "{data.maps}/HashMap.as" ;
     
     source = "the root : {root} - the class : {data.maps.HashMap}" ;
     
     trace( exp.format( source ) ) ;
     
     trace( "----" ) ;
     
     exp["system"]            = "%root%/project/system" ;
     exp["data.maps"]         = "%system%/data/map" ;
     exp["data.maps.HashMap"] = "%data.map%/HashMap.as" ;
     
     exp.beginSeparator = "%" ;
     exp.endSeparator   = "%" ;
     
     source = "the root : %root% - the class : %data.maps.HashMap%" ;
     
     trace( exp.format( source ) ) ;
     



Public Properties
 PropertyDefined by
  beginSeparator : String
The begin separator of the expression to format (default "{").
Expression
  endSeparator : String
The end separator of the expression to format (default "}").
Expression
  MAX_RECURSION : uint = 200
[static] The max recursion value.
Expression
Public Methods
 MethodDefined by
  
Expression(weakKeys:Boolean = false)
Creates a new Expression instance.
Expression
  
format(value:* = null):String
Formats the specified value.
Expression
Property detail
beginSeparatorproperty
beginSeparator:String  [read-write]

The begin separator of the expression to format (default "{").

Implementation
    public function get beginSeparator():String
    public function set beginSeparator(value:String):void
endSeparatorproperty 
endSeparator:String  [read-write]

The end separator of the expression to format (default "}").

Implementation
    public function get endSeparator():String
    public function set endSeparator(value:String):void
MAX_RECURSIONproperty 
public static var MAX_RECURSION:uint = 200

The max recursion value.

Constructor detail
Expression()constructor
public function Expression(weakKeys:Boolean = false)

Creates a new Expression instance.

Parameters
weakKeys:Boolean (default = false) — Instructs the Dictionary object to use "weak" references on object keys. If the only reference to an object is in the specified Dictionary object, the key is eligible for garbage collection and is removed from the table when the object is collected.
Method detail
format()method
public function format(value:* = null):String

Formats the specified value.

Parameters
value:* (default = null)

Returns
String — the string representation of the formatted value.