Class baja.Format
Extends
baja.Simple.
Format is used to format Objects into Strings using
a standardized formatting pattern language.
Currently this implementation of Format is limited to processing Lexicon patterns.
This Constructor shouldn't be invoked directly. Please use the 'make' methods to create
an instance of a Format.
Defined in: obj.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
baja.Format.DEFAULT
Default Format instance.
|
- Fields borrowed from class baja.Value:
- newCopy
- Fields borrowed from class baja.Object:
- equivalent, getIcon
| Method Attributes | Method Name and Description |
|---|---|
|
decodeFromString(str)
Decode a String to a Format.
|
|
|
Encode Format to a String.
|
|
|
format(obj)
Format the specified object using the format pattern.
|
|
| <static> |
baja.Format.format(obj)
Format the specified object using the format pattern.
|
| <static> |
baja.Format.make(pattern)
Make a Format.
|
|
make(pattern)
Make a Format.
|
|
|
toString()
Return a String representation of the Format.
|
|
|
valueOf()
Return the inner value of the Format.
|
- Methods borrowed from class baja.Simple:
- equals
Field Detail
<static>
baja.Format.DEFAULT
Default Format instance.
Method Detail
{baja.Format}
decodeFromString(str)
Decode a String to a Format.
- Parameters:
- {String} str
- Returns:
- {baja.Format}
{String}
encodeToString()
Encode Format to a String.
- Returns:
- {String}
{String}
format(obj)
Format the specified object using the format pattern.
- Parameters:
- obj
- Returns:
- {String}
<static>
{String}
baja.Format.format(obj)
Format the specified object using the format pattern.
This method can take an Object Literal or a single pattern String argument.
- Parameters:
- {Object} obj
- the Object Literal.
- {String} obj.pattern
- the format pattern to process.
- {Boolean} obj.display Optional
- if true, the display string of a Property value is used. If false, the toString version of a Property value is used. By default, this value is true (in BajaScript, most of the time we're dealing with mounted Components in a Proxy Component Space).
- Returns:
- {String}
<static>
{baja.Format}
baja.Format.make(pattern)
Make a Format.
- Parameters:
- {String} pattern Optional
- the Format Pattern String.
- Returns:
- {baja.Format}
{baja.Format}
make(pattern)
Make a Format.
- Parameters:
- {String} pattern Optional
- the Format Pattern String.
- Returns:
- {baja.Format}
{String}
toString()
Return a String representation of the Format.
- Returns:
- {String}
{String}
valueOf()
Return the inner value of the Format.
- Returns:
- {String}