如何根据Java类的API文档使用它
我对 Java 很陌生,需要从事一个需要使用开源软件的项目。我对理解那些 Java API 的文档感到非常困惑。 作为示例,您能否向我展示如何基于 Java API 使用相关的 java 类 RemoteXmlSimpleSearchEngineBase。
我对这个推导过程非常感兴趣,这样我就可以在阅读其API文档的基础上使用其他java类。谢谢。
I am quite new to Java, and need to work on a project requiring using open source software. I am very confusing about understanding those Java API's documentation.
As an example, can you show me how to use the related java class, RemoteXmlSimpleSearchEngineBase, based on its Java API.
Please refer to this link
http://download.carrot2.org/stable/javadoc/org/carrot2/source/xml/RemoteXmlSimpleSearchEngineBase.html
I am very interested in this derivation process, so that I can use other java classes based on reading its API documentation. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
通常,JavaDoc 不会解释库的一般概念,而只是解释该类的 API。它可能包含更多有用的信息(如 JDK JavaDocs 所做的那样),但一般来说,您应该尝试获取用户手册、参考或入门指南。
从JavaDoc中你仍然可以学到一些东西:
但是,您通常不了解一般概念,或者何时调用方法,如何为各种用例配置类等。您根本无法将所有这些都放入 API 中文档。
Often the JavaDoc doesn't explain the general concept of a library but just the API for that class. It might contain more useful information (like the JDK JavaDocs do), but in general you should try to get a user manual, reference or getting started guide.
From the JavaDoc you can still learn a few things:
However, you often don't get the general concept or when a method is called, how to configure a class for various use cases etc. You simply can't put that all into an API documention.
也许您应该查看项目文档:
http://project.carrot2.org/documentation.html< /a>
您有一些示例和大量信息。
Maybe you should take a look to the project documentation:
http://project.carrot2.org/documentation.html
You have some examples and lot of information.
当我试图了解某些 API 时,我经常发现有用的是类/接口树,甚至更多的是“使用”页面 - 它们显示哪些其他类/接口在其 API 中使用此类/接口。这展示了如何获取某种类型的对象(通过查找返回值),或者如何处理某些对象(除了使用其方法本身)。
遗憾的是,后者不是默认生成的(并且在您问题的示例中也缺失)。
What I often find useful when trying to get an overview over some API are the class/interface trees, and even more the "Usage" pages - they show which other classes/interfaces use this class/interface in their API. This shows how to get some type of object (by finding return values), or what to do with some object (except from using its methods itself).
Sadly, the latter ones are not generated by default (and also missing in the example in your question).
很多时候,JavaDoc 概述页面会提供一些 API 概述和代码示例。 Carrot2 JavaDoc 的情况实际上就是这样:
http://download.carrot2。 org/stable/javadoc/overview-summary.html#overview_description
Very often, the JavaDoc overview page will have some overview of the API and code examples. This is actually the case with Carrot2 JavaDoc:
http://download.carrot2.org/stable/javadoc/overview-summary.html#overview_description