[注意事项&车轮]java源代码 产生局部javadoc api档
随着Eclipse书写java码时间,有时候,因为我们不知道java函数返回。通过鼠标移动到java该功能,假设它javadoc相关内容将被显示。
但是,并非所有java代码javadoc;连装javadoc。于eclipse假设没有设置。使用。
我在win7下安装的是javase的jdk。发现eclipse中默认的javadoc路径是http://download.oracle.com/javase/7/docs/api/,显然这是一个在线资源。问题是网络总是不稳定的,有时候看不到相应的文档内容。
so,what should we do?and what can we do?!
一个显而易见的解决方法是下载javadoc并在本地安装。然后在eclipse中改动javadoc的路径。可是,为什么要下载javadoc?不是有一个命令也叫javadoc的么?不能用么?在java安装路径下能够找到一个叫src.zip的压缩包,里面是java的源代码,并且有凝视,应该能够生成javadoc的。到oracle官方上看了一下。发现javase版本号的jdk就是不带文档的,而javaee版本号的jdk却带文档。好吧,反正我对oracle没有什么好感。对此我仅仅能呵呵。
怎样手动生成本地javadoc api文档?对于jdk中的java源代码,由于包括太多的包,因此须要统计全部使用到的包。也就是“当前路径下包括java文件的全部目录”。
ok。由于google不能用。百度出来的结果基本上是没參考价值,唯一实用的一个是分析swf源代码的样例,够了。通过获取全部包的路径并存储在一个叫package.txt的文件里。并存储在java源代码解压后的路径src下,然后执行cmd。cd到src路径,输入javadoc javadoc -d api @package.txt命令,静候5分钟,文档就会生成完成!
然后我们也能够通过chrome打开。比方JComponent.html页面:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveno5NTg3MTI1Njg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
附:用来获取java源代码中全部包括java文件的文件夹的代码:
package util; import java.io.File;
import java.util.Vector; public class SniffDir {
private String srcDir;
private Vector<String> vs;
public SniffDir(){
srcDir="D:/workspace/src";
vs=new Vector<String>();
}
/**
* Sniff函数, 事实上就是一个DFS,深度优先搜索
* 用来获取src文件夹下的满足“当前路径下存在.java文件”这一条件的全部文件夹
* @param file
*/
public void Sniff(File file) {
//File file=new File(curDir);
File[] files=file.listFiles();
int len=files.length;
boolean ok=false;//表示当前文件夹下是否有java文件,ok=true表示有而且记录过了。 for(int i=0; i<len; i++){
//System.out.println(files[i].toString());
if(files[i].isDirectory()){
Sniff(files[i]);
}else if(files[i].isFile() && !ok){//files[i]为文件(肯定是java文件)。而且还没有把当前路径放入向量vs中
ok=true;
vs.addElement(file.toString().substring(srcDir.length()+1));
//System.out.println(files[i].toString());
}
}
}
String sb=null;
public void Print(){
int len=vs.size();
for(int i=0; i<len; i++){
sb=vs.get(i);
sb=sb.replace('\\', '.');
System.out.println(sb);
}
}
public static void main(String[] args){
SniffDir sd=new SniffDir();
sd.Sniff(new File(sd.srcDir));
sd.Print();
}
}
获取的结果(存储在package.txt中并放到src文件夹下就可以):
com.sun.corba.se.impl.activation
com.sun.corba.se.impl.copyobject
com.sun.corba.se.impl.corba
com.sun.corba.se.impl.dynamicany
com.sun.corba.se.impl.encoding
com.sun.corba.se.impl.interceptors
com.sun.corba.se.impl.io
com.sun.corba.se.impl.ior
com.sun.corba.se.impl.ior.iiop
com.sun.corba.se.impl.javax.rmi.CORBA
com.sun.corba.se.impl.javax.rmi
com.sun.corba.se.impl.legacy.connection
com.sun.corba.se.impl.logging
com.sun.corba.se.impl.monitoring
com.sun.corba.se.impl.naming.cosnaming
com.sun.corba.se.impl.naming.namingutil
com.sun.corba.se.impl.naming.pcosnaming
com.sun.corba.se.impl.oa
com.sun.corba.se.impl.oa.poa
com.sun.corba.se.impl.oa.toa
com.sun.corba.se.impl.orb
com.sun.corba.se.impl.orbutil
com.sun.corba.se.impl.orbutil.closure
com.sun.corba.se.impl.orbutil.concurrent
com.sun.corba.se.impl.orbutil.fsm
com.sun.corba.se.impl.orbutil.graph
com.sun.corba.se.impl.orbutil.threadpool
com.sun.corba.se.impl.presentation.rmi
com.sun.corba.se.impl.protocol
com.sun.corba.se.impl.protocol.giopmsgheaders
com.sun.corba.se.impl.resolver
com.sun.corba.se.impl.transport
com.sun.corba.se.impl.util
com.sun.corba.se.internal.corba
com.sun.corba.se.internal.CosNaming
com.sun.corba.se.internal.iiop
com.sun.corba.se.internal.Interceptors
com.sun.corba.se.internal.POA
com.sun.corba.se.org.omg.CORBA
com.sun.corba.se.pept.broker
com.sun.corba.se.pept.encoding
com.sun.corba.se.pept.protocol
com.sun.corba.se.pept.transport
com.sun.corba.se.PortableActivationIDL
com.sun.corba.se.PortableActivationIDL.InitialNameServicePackage
com.sun.corba.se.PortableActivationIDL.LocatorPackage
com.sun.corba.se.PortableActivationIDL.RepositoryPackage
com.sun.corba.se.spi.activation
com.sun.corba.se.spi.activation.InitialNameServicePackage
com.sun.corba.se.spi.activation.LocatorPackage
com.sun.corba.se.spi.activation.RepositoryPackage
com.sun.corba.se.spi.copyobject
com.sun.corba.se.spi.encoding
com.sun.corba.se.spi.extension
com.sun.corba.se.spi.ior
com.sun.corba.se.spi.ior.iiop
com.sun.corba.se.spi.legacy.connection
com.sun.corba.se.spi.legacy.interceptor
com.sun.corba.se.spi.logging
com.sun.corba.se.spi.monitoring
com.sun.corba.se.spi.oa
com.sun.corba.se.spi.orb
com.sun.corba.se.spi.orbutil.closure
com.sun.corba.se.spi.orbutil.fsm
com.sun.corba.se.spi.orbutil.proxy
com.sun.corba.se.spi.orbutil.threadpool
com.sun.corba.se.spi.presentation.rmi
com.sun.corba.se.spi.protocol
com.sun.corba.se.spi.resolver
com.sun.corba.se.spi.servicecontext
com.sun.corba.se.spi.transport
com.sun.image.codec.jpeg
com.sun.imageio.plugins.bmp
com.sun.imageio.plugins.common
com.sun.imageio.plugins.gif
com.sun.imageio.plugins.jpeg
com.sun.imageio.plugins.png
com.sun.imageio.plugins.wbmp
com.sun.imageio.spi
com.sun.imageio.stream
com.sun.java.swing
com.sun.java.swing.plaf.gtk
com.sun.java.swing.plaf.motif
com.sun.java.swing.plaf.motif.resources
com.sun.java.swing.plaf.nimbus
com.sun.java.swing.plaf.windows
com.sun.java.swing.plaf.windows.resources
com.sun.javadoc
com.sun.java_cup.internal.runtime
com.sun.jmx.defaults
com.sun.jmx.interceptor
com.sun.jmx.mbeanserver
com.sun.jmx.remote.internal
com.sun.jmx.remote.protocol.iiop
com.sun.jmx.remote.protocol.rmi
com.sun.jmx.remote.security
com.sun.jmx.remote.util
com.sun.jmx.snmp.agent
com.sun.jmx.snmp
com.sun.jmx.snmp.daemon
com.sun.jmx.snmp.defaults
com.sun.jmx.snmp.internal
com.sun.jmx.snmp.IPAcl
com.sun.jmx.snmp.mpm
com.sun.jmx.snmp.tasks
com.sun.jmx.trace
com.sun.mirror.apt
com.sun.mirror.declaration
com.sun.mirror.type
com.sun.mirror.util
com.sun.naming.internal
com.sun.org.apache.bcel.internal.classfile
com.sun.org.apache.bcel.internal
com.sun.org.apache.bcel.internal.generic
com.sun.org.apache.bcel.internal.util
com.sun.org.apache.regexp.internal
com.sun.org.apache.xalan.internal.extensions
com.sun.org.apache.xalan.internal.lib
com.sun.org.apache.xalan.internal.res
com.sun.org.apache.xalan.internal.templates
com.sun.org.apache.xalan.internal.utils
com.sun.org.apache.xalan.internal
com.sun.org.apache.xalan.internal.xslt
com.sun.org.apache.xalan.internal.xsltc.cmdline
com.sun.org.apache.xalan.internal.xsltc.cmdline.getopt
com.sun.org.apache.xalan.internal.xsltc
com.sun.org.apache.xalan.internal.xsltc.compiler
com.sun.org.apache.xalan.internal.xsltc.compiler.util
com.sun.org.apache.xalan.internal.xsltc.dom
com.sun.org.apache.xalan.internal.xsltc.runtime
com.sun.org.apache.xalan.internal.xsltc.runtime.output
com.sun.org.apache.xalan.internal.xsltc.trax
com.sun.org.apache.xalan.internal.xsltc.util
com.sun.org.apache.xerces.internal.dom
com.sun.org.apache.xerces.internal.dom.events
com.sun.org.apache.xerces.internal.impl
com.sun.org.apache.xerces.internal.impl.dtd
com.sun.org.apache.xerces.internal.impl.dtd.models
com.sun.org.apache.xerces.internal.impl.dv
com.sun.org.apache.xerces.internal.impl.dv.dtd
com.sun.org.apache.xerces.internal.impl.dv.util
com.sun.org.apache.xerces.internal.impl.dv.xs
com.sun.org.apache.xerces.internal.impl.io
com.sun.org.apache.xerces.internal.impl.msg
com.sun.org.apache.xerces.internal.impl.validation
com.sun.org.apache.xerces.internal.impl.xpath.regex
com.sun.org.apache.xerces.internal.impl.xpath
com.sun.org.apache.xerces.internal.impl.xs
com.sun.org.apache.xerces.internal.impl.xs.identity
com.sun.org.apache.xerces.internal.impl.xs.models
com.sun.org.apache.xerces.internal.impl.xs.opti
com.sun.org.apache.xerces.internal.impl.xs.traversers
com.sun.org.apache.xerces.internal.impl.xs.util
com.sun.org.apache.xerces.internal.jaxp.datatype
com.sun.org.apache.xerces.internal.jaxp
com.sun.org.apache.xerces.internal.jaxp.validation
com.sun.org.apache.xerces.internal.parsers
com.sun.org.apache.xerces.internal.util
com.sun.org.apache.xerces.internal.utils
com.sun.org.apache.xerces.internal.xinclude
com.sun.org.apache.xerces.internal.xni
com.sun.org.apache.xerces.internal.xni.grammars
com.sun.org.apache.xerces.internal.xni.parser
com.sun.org.apache.xerces.internal.xpointer
com.sun.org.apache.xerces.internal.xs
com.sun.org.apache.xerces.internal.xs.datatypes
com.sun.org.apache.xml.internal.dtm
com.sun.org.apache.xml.internal.dtm.ref
com.sun.org.apache.xml.internal.dtm.ref.dom2dtm
com.sun.org.apache.xml.internal.dtm.ref.sax2dtm
com.sun.org.apache.xml.internal.res
com.sun.org.apache.xml.internal.resolver
com.sun.org.apache.xml.internal.resolver.helpers
com.sun.org.apache.xml.internal.resolver.readers
com.sun.org.apache.xml.internal.resolver.tools
com.sun.org.apache.xml.internal.security.algorithms
com.sun.org.apache.xml.internal.security.algorithms.implementations
com.sun.org.apache.xml.internal.security.c14n
com.sun.org.apache.xml.internal.security.c14n.helper
com.sun.org.apache.xml.internal.security.c14n.implementations
com.sun.org.apache.xml.internal.security.encryption
com.sun.org.apache.xml.internal.security.exceptions
com.sun.org.apache.xml.internal.security
com.sun.org.apache.xml.internal.security.keys.content
com.sun.org.apache.xml.internal.security.keys.content.keyvalues
com.sun.org.apache.xml.internal.security.keys.content.x509
com.sun.org.apache.xml.internal.security.keys
com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations
com.sun.org.apache.xml.internal.security.keys.keyresolver
com.sun.org.apache.xml.internal.security.keys.storage.implementations
com.sun.org.apache.xml.internal.security.keys.storage
com.sun.org.apache.xml.internal.security.signature
com.sun.org.apache.xml.internal.security.transforms
com.sun.org.apache.xml.internal.security.transforms.implementations
com.sun.org.apache.xml.internal.security.transforms.params
com.sun.org.apache.xml.internal.security.utils
com.sun.org.apache.xml.internal.security.utils.resolver.implementations
com.sun.org.apache.xml.internal.security.utils.resolver
com.sun.org.apache.xml.internal.serialize
com.sun.org.apache.xml.internal.serializer
com.sun.org.apache.xml.internal.serializer.utils
com.sun.org.apache.xml.internal.utils
com.sun.org.apache.xml.internal.utils.res
com.sun.org.apache.xpath.internal
com.sun.org.apache.xpath.internal.axes
com.sun.org.apache.xpath.internal.compiler
com.sun.org.apache.xpath.internal.domapi
com.sun.org.apache.xpath.internal.functions
com.sun.org.apache.xpath.internal.jaxp
com.sun.org.apache.xpath.internal.objects
com.sun.org.apache.xpath.internal.operations
com.sun.org.apache.xpath.internal.patterns
com.sun.org.apache.xpath.internal.res
com.sun.security.auth.callback
com.sun.security.auth
com.sun.security.auth.login
com.sun.security.auth.module
com.sun.security.jgss
com.sun.source.tree
com.sun.source.util
java.applet
java.awt
java.awt.color
java.awt.datatransfer
java.awt.dnd
java.awt.dnd.peer
java.awt.event
java.awt.font
java.awt.geom
java.awt.im
java.awt.im.spi
java.awt.image
java.awt.image.renderable
java.awt.peer
java.awt.print
java.beans
java.beans.beancontext
java.io
java.lang
java.lang.annotation
java.lang.instrument
java.lang.invoke
java.lang.management
java.lang.ref
java.lang.reflect
java.math
java.net
java.nio
java.nio.channels
java.nio.channels.spi
java.nio.charset
java.nio.charset.spi
java.nio.file
java.nio.file.attribute
java.nio.file.spi
java.rmi
java.rmi.activation
java.rmi.dgc
java.rmi.registry
java.rmi.server
java.security
java.security.acl
java.security.cert
java.security.interfaces
java.security.spec
java.sql
java.text
java.text.spi
java.util
java.util.concurrent
java.util.concurrent.atomic
java.util.concurrent.locks
java.util.jar
java.util.logging
java.util.prefs
java.util.regex
java.util.spi
java.util.zip
javax.accessibility
javax.annotation
javax.annotation.processing
javax.imageio.event
javax.imageio
javax.imageio.metadata
javax.imageio.plugins.bmp
javax.imageio.plugins.jpeg
javax.imageio.spi
javax.imageio.stream
javax.lang.model.element
javax.lang.model
javax.lang.model.type
javax.lang.model.util
javax.management
javax.management.loading
javax.management.modelmbean
javax.management.monitor
javax.management.openmbean
javax.management.relation
javax.management.remote
javax.management.remote.rmi
javax.management.timer
javax.naming
javax.naming.directory
javax.naming.event
javax.naming.ldap
javax.naming.spi
javax.print.attribute
javax.print.attribute.standard
javax.print
javax.print.event
javax.rmi.CORBA
javax.rmi
javax.rmi.ssl
javax.script
javax.security.auth
javax.security.auth.callback
javax.security.auth.kerberos
javax.security.auth.login
javax.security.auth.spi
javax.security.auth.x500
javax.security.cert
javax.security.sasl
javax.sound.midi
javax.sound.midi.spi
javax.sound.sampled
javax.sound.sampled.spi
javax.sql
javax.sql.rowset
javax.sql.rowset.serial
javax.sql.rowset.spi
javax.swing
javax.swing.border
javax.swing.colorchooser
javax.swing.event
javax.swing.filechooser
javax.swing.plaf
javax.swing.plaf.basic
javax.swing.plaf.metal
javax.swing.plaf.multi
javax.swing.plaf.nimbus
javax.swing.plaf.synth
javax.swing.table
javax.swing.text
javax.swing.text.html
javax.swing.text.html.parser
javax.swing.text.rtf
javax.swing.tree
javax.swing.undo
javax.tools
javax.xml.bind.annotation.adapters
javax.xml.bind.annotation
javax.xml.bind.attachment
javax.xml.bind
javax.xml.bind.helpers
javax.xml.bind.util
javax.xml.crypto
javax.xml.crypto.dom
javax.xml.crypto.dsig
javax.xml.crypto.dsig.dom
javax.xml.crypto.dsig.keyinfo
javax.xml.crypto.dsig.spec
javax.xml.datatype
javax.xml.namespace
javax.xml.parsers
javax.xml.soap
javax.xml.stream
javax.xml.stream.events
javax.xml.stream.util
javax.xml.transform.dom
javax.xml.transform
javax.xml.transform.sax
javax.xml.transform.stax
javax.xml.transform.stream
javax.xml.validation
javax.xml.ws
javax.xml.ws.handler
javax.xml.ws.handler.soap
javax.xml.ws.http
javax.xml.ws.soap
javax.xml.ws.spi
javax.xml.ws.spi.http
javax.xml.ws.wsaddressing
javax.xml
javax.xml.xpath
launcher
org.ietf.jgss
org.omg.CORBA
org.omg.CORBA.DynAnyPackage
org.omg.CORBA.ORBPackage
org.omg.CORBA.portable
org.omg.CORBA.TypeCodePackage
org.omg.CORBA_2_3
org.omg.CORBA_2_3.portable
org.omg.CosNaming
org.omg.CosNaming.NamingContextExtPackage
org.omg.CosNaming.NamingContextPackage
org.omg.Dynamic
org.omg.DynamicAny
org.omg.DynamicAny.DynAnyFactoryPackage
org.omg.DynamicAny.DynAnyPackage
org.omg.IOP
org.omg.IOP.CodecFactoryPackage
org.omg.IOP.CodecPackage
org.omg.Messaging
org.omg.PortableInterceptor
org.omg.PortableInterceptor.ORBInitInfoPackage
org.omg.PortableServer
org.omg.PortableServer.CurrentPackage
org.omg.PortableServer.POAManagerPackage
org.omg.PortableServer.POAPackage
org.omg.PortableServer.portable
org.omg.PortableServer.ServantLocatorPackage
org.omg.SendingContext
org.omg.stub.java.rmi
org.w3c.dom
org.w3c.dom.bootstrap
org.w3c.dom.css
org.w3c.dom.events
org.w3c.dom.html
org.w3c.dom.ls
org.w3c.dom.ranges
org.w3c.dom.stylesheets
org.w3c.dom.traversal
org.w3c.dom.views
org.w3c.dom.xpath
org.xml.sax
org.xml.sax.ext
org.xml.sax.helpers
sunw.io
sunw.util
版权声明:本文博主原创文章,博客,未经同意不得转载。
[注意事项&车轮]java源代码 产生局部javadoc api档的更多相关文章
- 中国象棋V2:Java源代码、毕业设计等所有文档,已经全部提交到CSDN-Code平台
下载地址:https://code.csdn.net/FansUnion/chinesechess-v2 主要内容:Java源代码.毕业设计.API文档.声音图片等资源.Demo截图等一切的一切. 2 ...
- 运用加密技术保护Java源代码(转)
出处:运用加密技术保护Java源代码 为什么要加密? 对于传统的C或C++之类的语言来说,要在Web上保护源代码是很容易的,只要不发布它就可以.遗憾的是,Java程序的源代码很容易被别人偷看.只要有一 ...
- 分治法解决合并排序(c++和Java源代码)
Java源代码 public class Mergesort1 { public static void merge(int[]a,int low,int mid,int high){//对两组已经排 ...
- java程序保护如何知识产权,特别提供一个java 开发的java 源代码级的混淆器
java程序保护如何知识产权,特别提供一个java 开发的java 源代码级的混淆器 下载地址:http://yunpan.cn/QXhEcGNYLgwTD 运行方式:java -jar Encryp ...
- 全中国的省市县镇乡村数据获取以及展示java源代码
第一步.准备工作(数据源+工具): 数据源(截止目前最全面权威的官方数据):http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2013/ 爬取数据的工具 ...
- java源代码分析----jvm.dll装载过程
简述众所周知java.exe是java class文件的执行程序,但实际上java.exe程序只是一个执行的外壳,它会装载jvm.dll(windows下,以下皆以windows平台为例,linux下 ...
- PowerDesigner(八)-面向对象模型(用例图,序列图,类图,生成Java源代码及Java源代码生成类图)(转)
面向对象模型 面向对象模型是利用UML(统一建模语言)的图形来描述系统结构的模型,它从不同角度实现系统的工作状态.这些图形有助于用户,管理人员,系统分析人员,开发人员,测试人员和其他人员之间进行信息交 ...
- Android APK反编译得到Java源代码和资源文件
在此郑重声明,贴出来的目的不是为了去破解人家的软件,完全是一种学习的态度,不过好像通过这种方式也可以去汉化一些外国软件. 一.反编译Apk得到Java源代码 首先要下载两个工具:dex2jar和JD- ...
- MyEclipse13中修改Servlet.java源代码
Servlet.java源代码想要修改的步骤,与低版本的不同废话少说,直接来步骤: 1,在myEclipse的安装目录中搜索com.genuitec.eclipse.wizards文件,如图:选择co ...
随机推荐
- 【Android基础】listview控件的使用(3)------Map与SimpleAdapter组成的多显示条目的Listview
前面介绍的两种listview的使用都是最基础的,所以有很大的局限性,比如只能在一个item(即每一行的条目)中显示一个文本信息,这一篇我将介绍Map与SimpleAdapter组成的多显示条目的Li ...
- Build制作模型
#include <iostream> using namespace std; //不知道为什么事实上非常好解释的东西在网上搞的人晕头转向的,下面是我的理解. //一个基类衍生出很多详细 ...
- linux下磁盘进行分区、文件系统创建、挂载和卸载(转)
任务的原因:由于,刚购买来的服务器需要将磁盘挂载到操作系统上,为了挂载磁盘首先要对磁盘进行分区,然后进行文件系统的创建,最后将磁盘挂载到操作系统上的某个目录. MBR(Master Boot Reco ...
- 一起学习android图像缩放资源 (27)
效果图: 在平时载入图片时,我会使用SetImageBitmap.setImageResource.BitmapFactory.decodeResource来设置一张图 片通过以上方法来设置图片时.会 ...
- JAVA对数据库进行操作,实现数据库中数据的插入,查询,更改,删除操作
(—)通过mysql workbench 创建一个数据库,在这里命名为company,然后建一个tb_employee表 (二)以下是java代码对表tb_employee的操作 1 创建一个Empl ...
- 第一篇——第一文 SQL Server 备份基础
原文:第一篇--第一文 SQL Server 备份基础 当看这篇文章之前,请先给你的所有重要的库做一次完整数据库备份.下面正式开始备份还原的旅程. 原文出处: http://blog.csdn.net ...
- ObjectStreamDemo
当你需要存储相同类型的数据时,使用固定长度的记录格式是一个不错的选择.但,在OOP中创建的对象很少全部都具有相同的类型. 例如,你可能有一个称为staff(见下面demo)的array,它名义上是一个 ...
- Java版网络爬虫基础(转)
网络爬虫不仅仅可以爬取网站的网页,图片,甚至可以实现抢票功能,网上抢购,机票查询等.这几天看了点基础,记录下来. 网页的关系可以看做是一张很大的图,图的遍历可以分为深度优先和广度优先.网络爬虫采取的广 ...
- UVa - The 3n + 1 problem 解读
这个问题并计算质数了一下相间隔似的.思想上一致. 注意问题: 1 i 可能 大于或等于j -- 这里上传.小心阅读题意,我没有说这个地方不能保证.需要特殊处理 2 计算过程中可能溢出,的整数大于最大值 ...
- [SignalR]初步认识以及安装
原文:[SignalR]初步认识以及安装 1.什么是ASP.NET SignalR? ASP .NET SignalR是一个 ASP .NET 下的类库,可以在ASP .NET 的Web项目中实现实时 ...