| Package | system.formatters |
| Class | public dynamic class ExpressionFormatter |
| Inheritance | ExpressionFormatter flash.utils.Dictionary |
| Implements | Formattable |
| Subclasses | TypeExpression |
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
| Property | Defined 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 | ||
| Method | Defined By | ||
|---|---|---|---|
ExpressionFormatter(weakKeys:Boolean = false)
Creates a new Expression instance. | ExpressionFormatter | ||
format(value:* = null):String
Formats the specified value. | ExpressionFormatter | ||
| beginSeparator | property |
beginSeparator:StringThe begin separator of the expression to format (default "{").
public function get beginSeparator():String public function set beginSeparator(value:String):void| endSeparator | property |
endSeparator:StringThe end separator of the expression to format (default "}").
public function get endSeparator():String public function set endSeparator(value:String):void| MAX_RECURSION | property |
public static var MAX_RECURSION:uint = 200The max recursion value.
| ExpressionFormatter | () | Constructor |
public function ExpressionFormatter(weakKeys:Boolean = false)Creates a new Expression instance.
ParametersweakKeys: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.
|
| format | () | method |
public function format(value:* = null):StringFormats the specified value.
Parameters
value:* (default = null) — The object to format.
|
String — the string representation of the formatted value.
|