没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > javamoney |
javamoney
|
1 | 0 | 2088 |
贡献者 | 讨论 | 代码提交 |
Dealing with monetary values consistently in a large application is important.
Things that need to be considered are:-
precision rounding display formatting multi-currency database persistence
This collection of classes deals with the above issues.
The core Money class is a drop in replacement for BigDecimal with added functionality to deal with monetary values. If offers the following features:-
Consistent precision JDBC and JPA database persistence Self awareness Logging
Self awareness?Sometimes you need to have processing rules for a specific monetary field. Let's say that VAT needs to be calculated consistently across multiple applications. When a Money object is instantiated it can be given a name. Straight away this is used in any log messages. A listener can register its interest in all Money objects of a given name. Now whenever the field is changed or stored the listener is invoked where it can reprocess the value or take other customer actions.