Which jsr-275 units implementation should be used? [closed]

喜你入骨 提交于 2019-11-27 02:18:15

问题


JSR 275 seems to be in a rejected state. JScience seems to have an implementation and there seems to be unitsofmeasure.

  1. Are there any other open source implementations?
  2. Which package is jsr-275 compliant and easy to use.

回答1:


Since the JSR-275 has been rejected the javax namespace cannot be used and has been replaced by the namespace org.unitsofmeasurement. The JScience implementation has been released, latest as of this writing is version 4.3.1 in Oct 2012. Cheers, Jean-Marie Dautelle (JScience project owner)




回答2:


While JScience also plans to implement it at some point, please note JSR 363, the new Units of Measurement standard for Java (successor to JSR 275) is available in Early Draft stage, see http://unitsofmeasurement.github.io/ You'll also find the API and RI in places like MavenCentral.

Werner (Co Spec Lead, JSR 363)




回答3:


As @WernerKeil mentioned, the replacement seems to be JSR 363. I did a bit of research (this stuff is hard to find, scattered around everywhere with no clear overview, which is why I post this here) and it appears that you'll want to bring in the released unitofmeasurement dependency, e.g. from Maven like this:

<dependency>
  <groupId>javax.measure</groupId>
  <artifactId>unit-api</artifactId>
  <version>1.0</version>
</dependency>

Then in the final application you'll want an implementation, such as the reference implementation, e.g. from Maven:

<dependency>
  <groupId>tec.units</groupId>
  <artifactId>unit-ri</artifactId>
  <version>1.0.2</version>
</dependency>

I haven't tried this yet, but that looks the most promising so far.



来源:https://stackoverflow.com/questions/4224122/which-jsr-275-units-implementation-should-be-used

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!