Package | mx.formatters |
Class | public class Formatter |
Subclasses | NumberFormatter |
format()
method.
MXML Syntax Hide MXML Syntax
The Formatter class defines the following tag attributes, which all of its subclasses inherit:
<mx:tagname Properties error="" />
Property | Defined by | ||
---|---|---|---|
defaultInvalidFormatError : String [static]
Error message for an invalid format string specified to the formatter.
| Formatter | ||
defaultInvalidValueError : String [static]
Error messages for an invalid value specified to the formatter.
| Formatter | ||
error : String
Description saved by the formatter when an error occurs.
| Formatter |
Method | Defined by | ||
---|---|---|---|
Constructor.
| Formatter | ||
format(value:Object):String
Formats a value and returns a String
containing the new, formatted, value.
| Formatter |
Method | Defined by | ||
---|---|---|---|
resourcesChanged():void
This method is called when a Formatter is constructed,
and again whenever the ResourceManager dispatches
a
"change" Event to indicate
that the localized resources have changed in some way. | Formatter |
defaultInvalidFormatError | property |
defaultInvalidFormatError:String
[read-write]Error message for an invalid format string specified to the formatter.
The default value is "Invalid format"
.
public static function get defaultInvalidFormatError():String
public function set defaultInvalidFormatError(value:String):void
defaultInvalidValueError | property |
defaultInvalidValueError:String
[read-write]Error messages for an invalid value specified to the formatter.
The default value is "Invalid value"
.
public static function get defaultInvalidValueError():String
public function set defaultInvalidValueError(value:String):void
error | property |
public var error:String
Description saved by the formatter when an error occurs. For the possible values of this property, see the description of each formatter.
Subclasses must set this value
in the format()
method.
Formatter | () | constructor |
public function Formatter()
Constructor.
format | () | method |
public function format(value:Object):String
Formats a value and returns a String containing the new, formatted, value. All subclasses must override this method to implement the formatter.
Parametersvalue:Object — Value to be formatted.
|
String — The formatted string.
|
resourcesChanged | () | method |
protected function resourcesChanged():void
This method is called when a Formatter is constructed,
and again whenever the ResourceManager dispatches
a "change"
Event to indicate
that the localized resources have changed in some way.
This event will be dispatched when you set the ResourceManager's
localeChain
property, when a resource module
has finished loading, and when you call the ResourceManager's
update()
method.
Subclasses should override this method and, after calling
super.resourcesChanged()
, do whatever is appropriate
in response to having new resource values.