Google App Engine“重新包装”包 [英] Google App Engine "repackaged" package

查看:118
本文介绍了Google App Engine“重新包装”包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个包中的类的目的是什么?



我想在我的应用程序中使用Base64编码。当我在Eclipse中输入时,系统会提示是否要导入名为com.google.appengine.repackaged.com.google.common.util.Base64的类。



我找不到有关此课程的文档。没有javadoc,或在Google App Engine手册中没有提及(我可以看到)。这是一种我不应该访问的隐藏API吗?

解决方案


<


是。

这是一种我不应该访问的隐藏API吗? >

重新包装Java类的目的是拥有一个库的私有副本,否则可能与某个库的另一个版本发生冲突(应用程序开发人员将其作为jar添加到他的项目中文件)。



这是JAR-hell的一个可能答案。

即使JDK也利用这个机制,例如与com.sun.org.apache.xerces这是由Apache Project开发的XML解析库,Sun选择包含(重新包装)。



不要调用这些类直。 (你可以,他们可能会工作正常,但由于他们不是官方API的一部分,他们可能会在下一个版本中消失)。


What is the purpose of the classes in this package?

I want to use Base64 encoding in my app. As I'm typing away in Eclipse, I am prompted if I want to import a class called "com.google.appengine.repackaged.com.google.common.util.Base64"

I can't find any documentation about what this class does. No javadoc, or no mention in the Google App Engine manual (that I can see). Is this some kind of "hidden" API that I'm not supposed to have access to?

解决方案

Is this some kind of "hidden" API that I'm not supposed to have access to?

Yes.

The purpose of repackaging Java classes is to have a private copy of a library that otherwise might conflict with another version of that some library (that the application developer adds to his project as a jar file).

It is one possible answer to JAR-hell.

Even the JDK makes use of this mechanism, e.g. with com.sun.org.apache.xerces which is an XML parsing library developed by the Apache Project that Sun choose to include (repackaged).

Do not call these classes directly. (You could, and they would probably work okay, but as they are not part of the official API, they could disappear in the next version).

这篇关于Google App Engine“重新包装”包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆