Re: Anyone have a phone number formatter?
Re: Anyone have a phone number formatter?
- Subject: Re: Anyone have a phone number formatter?
- From: Chuck Hill <email@hidden>
- Date: Thu, 29 Mar 2007 17:09:06 -0700
If you just want output formatting (and not input parsing), it can be
as simple as this:
public StringBuffer format(Object object, StringBuffer
stringBuffer, FieldPosition fieldPosition)
{
if (object instanceof Number)
{
stringBuffer.append(((Number)object).intValue() == 2 ?
"Y" : "");
}
return stringBuffer;
}
/**
* @throw RuntimeException parseObject is not implemented
*/
public Object parseObject(String arg0, ParsePosition arg1)
{
throw new RuntimeException("parseObject is not implemented");
}
This is an output formatter that takes a number formats this to "Y"
if the value is 2 and to an empty string for all other values. Don't
ask, legacy data.
Chuck
On Mar 29, 2007, at 4:58 PM, Kevin Windham wrote:
I am looking for info on how to create a formatter for phone
numbers. I have surmised that I am supposed to use java.text.format
in some fashion, but I am having trouble finding any examples.
Does anyone have any examples they can share, or can point me to
some better info than the java docs on the class.
Thanks,
Kevin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden