Formatter types include: MAFAddressFormatter class for phone numbers and address field layout information, MAFDateTimeFormatter for date times, and MAFCurrencyFormatter for currencies.
All three types of formatters use metadata to format input values according to the predefined locale, country, and custom settings.
For MAFDateTimeFormatter, the metadata comes from and is handled completely by the Android frameworks. The formatter uses the java.text.DateFormat class to format date and time values according to locale and country settings.
For MAFAddressFormatter and MAFCurrencyFormatter, the metadata is loaded from the default XML.
<ISO_CURRENCY> <ENTITY>HUNGARY</ENTITY> <CURRENCY>Forint</CURRENCY> <ALPHABETIC_CODE>HUF</ALPHABETIC_CODE> <NUMERIC_CODE>348</NUMERIC_CODE> <MINOR_UNIT>2</MINOR_UNIT> </ISO_CURRENCY>
This information is also available in the low- and high-level public MAF APIs of the MAFAddressFormatter class. See the public API in the corresponding javadoc, and the MAFAddressFormatter section.
<!-- Hungary --> <format country="hu"> <addresses> <address format="POSTL_COD1 CITY\nSTREET HOUSE_NO\nLOCATION\nCOUNTRY" /> </addresses> <addressfields> <line> <field id="POSTL_COD1" keyboard="NUMERIC" label="{POSTAL_CODE}" /> <field id="CITY" label="{CITY}" /> </line> <line> <field id="STREET" width="65%" label="{STREET}" /> <field id="HOUSE_NO" keyboard="NUMERIC" width="35%" label="No." /> </line> <line> <field id="LOCATION" label="{STREET} 4" /> </line> <line> <field id="COUNTRY" label="{COUNTRY}" /> </line> </addressfields> <phonenumbers localprefix="06" internationalprefix="36 " outboundcode="00"> <phonenumber format="06 1 xxx-xxxx" /> <phonenumber format="06 xx xxx-xxx" /> <phonenumber format="06 xx xxx-xxxx" /> </phonenumbers> </format>