DO NOT REPLY [Bug 21663] - [lang] Add support in ToStringStyle for DateFormat.

2006-04-26 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=21663.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=21663


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED




--- Additional Comments From [EMAIL PROTECTED]  2006-04-26 06:10 ---
2.1 released, closing.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 21663] - [lang] Add support in ToStringStyle for DateFormat.

2004-10-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=21663.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=21663

[lang] Add support in ToStringStyle for DateFormat.

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX
   Target Milestone|--- |2.1 Final



--- Additional Comments From [EMAIL PROTECTED]  2004-10-16 18:25 ---
I have added some javadoc to ToStringStyle to demonstrate how to format fields.

The rest of this goes beyond lang at the moment into the realms of convert and 
the text package. The idea is not invalid though, so it may yet come back.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 21663] - [lang] Add support in ToStringStyle for DateFormat.

2004-06-26 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=21663.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=21663

[lang] Add support in ToStringStyle for DateFormat.





--- Additional Comments From [EMAIL PROTECTED]  2004-06-27 04:21 ---
Dropping this from 2.1 aims. Commons-Convert does seem the better choice if
people want this to be of a lot of use.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 21663] - [lang] Add support in ToStringStyle for DateFormat.

2003-07-21 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21663.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21663

[lang] Add support in ToStringStyle for DateFormat.





--- Additional Comments From [EMAIL PROTECTED]  2003-07-21 23:45 ---
A full converter approach is the right one if a change is to be made.

This should wait until after 2.0 though.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 21663] - [lang] Add support in ToStringStyle for DateFormat.

2003-07-17 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21663.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21663

[lang] Add support in ToStringStyle for DateFormat.





--- Additional Comments From [EMAIL PROTECTED]  2003-07-17 07:45 ---
Rather than adding support for just java.util.Date, consider adding support to 
allow a user to custom format any type of field.  Something like this:

1. Create an interface called say ToStringer

public class ToStringer{
  String toString(Object objectToFormat);
}

2. Add a method to ToStringStyle called say addToStringer to add custom 
formatters for specific field types.  Add a map field to hold the formatters.

public void addToStringer(Class type, ToStringer formatter){
   formatters.put(type,formatter);
}

3. Then a client will use/configure ToStringStyle like this to custom format 
say fields of type Dates, Doubles and Foos:

ToStringStyle t = new ToStringStyle();
t.addToStringer(java.util.Date.class,new ToStringer(){
String toString(Object date){
Date d = (Date date);
return new SimpleDateFormat(-MM-dd).format(d);
}
});
t.addToStringer(Double.class,new ToStringer(){
  String toString(Object decimal){
  return new DecimalFormat(#,000.).format(decimal);
  }
  });
t.addToStringer(Foo.class,new ToStringer(){
  String toString(Object foo){
  Foo f = (Foo)foo;
  return Foo object # + f.getId();
  }
  });
}

-Brian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 21663] - [lang] Add support in ToStringStyle for DateFormat.

2003-07-17 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21663.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21663

[lang] Add support in ToStringStyle for DateFormat.





--- Additional Comments From [EMAIL PROTECTED]  2003-07-17 17:01 ---
If we do something like that the interface function could also be (presumably
for internal efficiency):

append(Object object, StringBuffer buffer);

We can discuss the 3 approaches and see what people think.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 21663] - [lang] Add support in ToStringStyle for DateFormat.

2003-07-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21663.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21663

[lang] Add support in ToStringStyle for DateFormat.





--- Additional Comments From [EMAIL PROTECTED]  2003-07-16 18:50 ---
Created an attachment (id=7332)
ToStringBuilder.java

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]