Packagesystem.formatters
Classpublic dynamic class ExpressionFormatter
InheritanceExpressionFormatter Inheritance flash.utils.Dictionary
Implements Formattable
Subclasses TypeExpression

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



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

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

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
ExpressionFormatter()Constructor
public function ExpressionFormatter(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) — The object to format.

Returns
String — the string representation of the formatted value.