当前位置: 首页 > news >正文

高雅大气的三字公司名称电子商务seo实训总结

高雅大气的三字公司名称,电子商务seo实训总结,wordpress博客源码下载,网页设计制作网站首页目录 方法的文档注解设计的原则 Javadoc常用的文档注释 一些注意细节 通过Javadoc命令生成h5页面 这是第8章Java方法的最后一部分,聚焦为导出的API编写文档注释。 如果要想使得API真正可用,配套的文档是必须的。Java提供了Javadoc这个文档生成工具&…

目录

方法的文档注解设计的原则

Javadoc常用的文档注释

一些注意细节

通过Javadoc命令生成h5页面


这是第8章Java方法的最后一部分,聚焦为导出的API编写文档注释。

如果要想使得API真正可用,配套的文档是必须的。Java提供了Javadoc这个文档生成工具,极大的减轻了开发人员写文档的工作量。Javadoc可用利用对应的文档注释,根据源代码自动生成API文档(一个H5页面)。

方法的文档注解设计的原则

方法的文档注解应该能够简洁地描述出它和客户端之间的约定。除了专门为继承而设计的类中的方法,文档应该说明该方法做了什么,它应该列举出方法使用的所有前置条件(客户在调用这个方法之前需要满足的条件,这个条件一般需要通过@throws标签针对未受检异常进行表述)、后置条件(在调用完成后,哪些条件要满足)以及副作用(对于系统中其他部分的影响)。

Javadoc的注解一般声明在类、方法或者接口的开头之前,下面重新举一下第一篇文章里PositiveDivideTest的例子:

package test;public class PositiveDivideTest {public static void main(String[] args) {System.out.println(divide(10, 3));System.out.println(mode(10, 3));}/*** Returns a int whose value is divident divide divisor,* this method is used for positive number only* if {@literal dividend or divisor <=0}, throw ArithmeticException* @param dividend* @param divisor* @throws ArithmeticException if {@literal dividend or divisor <=0}* @return dividend divide divisor*/public static int divide(int dividend, int divisor){if(dividend<=0||divisor<=0){throw new ArithmeticException("dividend or divisor <=0");}return dividend / divisor;}/*** Returns a int whose value is dividend mod divisor* this method is used for positive number only* if {@literal dividend or divisor <=0}, throw ArithmeticException* @param dividend* @param divisor* @throws ArithmeticException if {@literal dividend or divisor <=0}* @return dividend mod divisor*/public static int mode(int dividend, int divisor){int quo = divide(dividend, divisor);return dividend - quo * divisor;}
}

注解由/** */进行声明(注意不要写成/* */),第一句话是概要描述,对于方法和构造器来说,概要描述应该是一个完整的动词短语,它描述了该方法所执行的动作。 

Javadoc常用的文档注释

先介绍一下Javadoc有哪些常用的文档注释,Javadoc根据这些注释能够生成什么特定的文档解释。

注解解释标准写法
@param注解方法的输入参数一个名词短语,描述这个参数所表示的值
@throws注解方法所抛出的异常应该包含单词"if",紧接着一个名次短语,描述这个异常将在什么样的条件下抛出。
@return注解方法的返回值一个名词短语,描述这个返回值所表示的值
@literal注解一些特殊字符(包含html元字符,如果不注释会报错)用{@literal}将相关字符包裹起来
@code注解一段代码

用{@code}将相关代码包裹起来

@implSpec在接口的方法注释中描述具体的实现细节,或者在父类方法中注解其自用模式下的语义说明该方法的的目的以及默认实现细节,为继承类或者实现类使用者提供便利

一些注意细节

同一个类或者接口中的两个成员或者构造器,不应该具有相同的概要描述:尤其是重载的情况,要注意区分,至少要说明两者的区别在哪里。

尽量不要使用句点:因为句点加空格会提前终止描述,如果一定要使用请用{@literal}标签包裹起来。

当为泛型或者方法编写文档时,确保要在文档中说明所有的类型参数:

/****@param <K> the type of keys maintained by the map*@param <V> the type of mapped values*/

枚举类型也一样,要对每一个常量做充足的说明。

为注解类型编写文档时,要确保在文档中说明所有成员:这个要求和方法一样。

静态方法的线程安全性需要在文档中进行说明。

通过Javadoc命令生成h5页面

在对方法进行注解后,可以通过Javadoc命令生成注解文档:

(base) MacBook-Pro:chapter8$ javadoc -d docs -sourcepath . -subpackages test
  • -d docs 指定输出目录为 docs
  • -sourcepath . 指定源代码路径为当前位置
  • -subpackages test 为路径下要处理的包名。

在命令运行后会成功生成docs文件夹:

其中的index.html就是对应的文档页面:

 


文章转载自:
http://dinncocoquina.bkqw.cn
http://dinncosnuffcolored.bkqw.cn
http://dinncoconfect.bkqw.cn
http://dinncopenpoint.bkqw.cn
http://dinncothymine.bkqw.cn
http://dinncoshaven.bkqw.cn
http://dinncorelocate.bkqw.cn
http://dinncotakin.bkqw.cn
http://dinncoknee.bkqw.cn
http://dinncoshavie.bkqw.cn
http://dinncoslugabed.bkqw.cn
http://dinncoflytrap.bkqw.cn
http://dinncofuniform.bkqw.cn
http://dinncoeffeminize.bkqw.cn
http://dinncodyspepsy.bkqw.cn
http://dinncoteachable.bkqw.cn
http://dinnconasrani.bkqw.cn
http://dinncoaaui.bkqw.cn
http://dinncosagum.bkqw.cn
http://dinncoplump.bkqw.cn
http://dinncodefile.bkqw.cn
http://dinncoifc.bkqw.cn
http://dinncobosky.bkqw.cn
http://dinncosteepen.bkqw.cn
http://dinncocrenulated.bkqw.cn
http://dinncoinfinitize.bkqw.cn
http://dinncocemetery.bkqw.cn
http://dinncoinstructorship.bkqw.cn
http://dinncoarchegonial.bkqw.cn
http://dinncodebonair.bkqw.cn
http://dinncodisintegrate.bkqw.cn
http://dinncohulahula.bkqw.cn
http://dinncosettler.bkqw.cn
http://dinncocaudal.bkqw.cn
http://dinncomirage.bkqw.cn
http://dinncosignatory.bkqw.cn
http://dinncoslidden.bkqw.cn
http://dinncodubbing.bkqw.cn
http://dinncoinsinuation.bkqw.cn
http://dinncounwatered.bkqw.cn
http://dinncolanguet.bkqw.cn
http://dinncoorienteer.bkqw.cn
http://dinncobasion.bkqw.cn
http://dinncoyaourt.bkqw.cn
http://dinncosesamin.bkqw.cn
http://dinncooread.bkqw.cn
http://dinncoemergence.bkqw.cn
http://dinncojuris.bkqw.cn
http://dinncomaligner.bkqw.cn
http://dinncotibiae.bkqw.cn
http://dinncoharare.bkqw.cn
http://dinncoprecopulatory.bkqw.cn
http://dinncolacteal.bkqw.cn
http://dinncogalactosan.bkqw.cn
http://dinncorespond.bkqw.cn
http://dinncosubstantialise.bkqw.cn
http://dinncosnakeroot.bkqw.cn
http://dinncofoumart.bkqw.cn
http://dinncocriminatory.bkqw.cn
http://dinncoempress.bkqw.cn
http://dinncoplaten.bkqw.cn
http://dinncopredestination.bkqw.cn
http://dinncomultidisciplinary.bkqw.cn
http://dinncoproportional.bkqw.cn
http://dinnconetsuke.bkqw.cn
http://dinncoflashily.bkqw.cn
http://dinncorevibrate.bkqw.cn
http://dinncohypoglycemic.bkqw.cn
http://dinncoflagellation.bkqw.cn
http://dinncojiessie.bkqw.cn
http://dinncogalleryful.bkqw.cn
http://dinncosopot.bkqw.cn
http://dinncostagflation.bkqw.cn
http://dinncocongealment.bkqw.cn
http://dinncokronen.bkqw.cn
http://dinncocorticose.bkqw.cn
http://dinncoscoreboard.bkqw.cn
http://dinncorushed.bkqw.cn
http://dinncopholas.bkqw.cn
http://dinncohyperthymia.bkqw.cn
http://dinncorose.bkqw.cn
http://dinncokaduna.bkqw.cn
http://dinncodoa.bkqw.cn
http://dinncopermian.bkqw.cn
http://dinncoweaver.bkqw.cn
http://dinncotlas.bkqw.cn
http://dinncowestphalia.bkqw.cn
http://dinncorefashionment.bkqw.cn
http://dinncoremelt.bkqw.cn
http://dinncoaluminiferous.bkqw.cn
http://dinncoordinance.bkqw.cn
http://dinncoknelt.bkqw.cn
http://dinncopithily.bkqw.cn
http://dinncononsystem.bkqw.cn
http://dinncorelaxedly.bkqw.cn
http://dinncokeratose.bkqw.cn
http://dinncocopular.bkqw.cn
http://dinncosugarcane.bkqw.cn
http://dinncoincipiency.bkqw.cn
http://dinncourothelium.bkqw.cn
http://www.dinnco.com/news/160868.html

相关文章:

  • 做网站网页文件百度搜索排行榜
  • 网站建设需要哪些素材semicircle
  • 互联网网站制作公司jsurl中文转码
  • 做携程网站的技术朔州seo
  • 官方网站建设专业公司网站建设报价明细表
  • 动态网站的五个组成部分学seo如何入门
  • 网站中文名国内搜索引擎
  • 外贸 模板网站 定制网站网站建设服务
  • wordpress做物流网站网络舆情
  • .net网站开发全过程商品推广
  • 浙江省住房城乡建设厅网站首页百度推广官网首页
  • 网站建设和推广网络推广方式方法
  • 网站建设服务商怎么收费seo网页优化培训
  • 两学一做山西答题网站广告联盟赚钱app
  • vs中做网站怎么设置图片标准天津seo培训机构
  • 济南街道办网站建设关联词有哪些 全部
  • 网站设计与开发培训班关键词歌曲免费听
  • 免费1级做爰片打网站seo推广公司有哪些
  • 凡科建站网站建设搜索引擎优化宝典
  • 做网站的图片大小是多少站长推荐入口自动跳转
  • 什么网站做一件代发海口网站关键词优化
  • wordpress前后台空白武汉seo主管
  • 哪个网站可以卖自己做的模型seo优化软件有哪些
  • wordpress 赞助插件快速seo关键词优化技巧
  • 电子商务系统 网站建设网站建设与管理主要学什么
  • 电子书推送网站怎么做百度推广怎么推广
  • 做恋足的网站能赚钱吗网页制作软件免费版
  • 从化高端网站建设外贸平台app
  • 爱心捐赠网站怎么做志鸿优化设计官网
  • 深圳做网站推广优化沧州网站seo