Skip to content

Commit e948a2c

Browse files
committedJan 4, 2019
Site updated: 2019-01-04 19:15:57
1 parent 68a6119 commit e948a2c

File tree

11 files changed

+1233
-413
lines changed

11 files changed

+1233
-413
lines changed
 

‎2019/01/04/安卓注解处理器-processor/index.html

+64-35
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969

7070

71-
<meta name="keywords" content="Hexo, NexT">
71+
<meta name="keywords" content="annotation、processor、自动生成java文件,">
7272

7373

7474

@@ -79,21 +79,21 @@
7979

8080

8181

82-
<meta name="description" content="1234title: 安卓注解处理器-processordate: 2019-01-04 19:02:34tags: annotation、processor、自动生成java文件category: 注解 最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为https://github.com">
83-
<meta name="keywords" content="Android">
82+
<meta name="description" content="最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为https://github.com/cugyong/AnnotationProcessor-sample ,如果喜欢的话,欢迎大家给star。">
83+
<meta name="keywords" content="annotation、processor、自动生成java文件">
8484
<meta property="og:type" content="article">
85-
<meta property="og:title" content="夏勇的个人博客">
85+
<meta property="og:title" content="安卓注解处理器-processor">
8686
<meta property="og:url" content="http://yoursite.com/2019/01/04/安卓注解处理器-processor/index.html">
8787
<meta property="og:site_name" content="夏勇的个人博客">
88-
<meta property="og:description" content="1234title: 安卓注解处理器-processordate: 2019-01-04 19:02:34tags: annotation、processor、自动生成java文件category: 注解 最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为https://github.com">
88+
<meta property="og:description" content="最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为https://github.com/cugyong/AnnotationProcessor-sample ,如果喜欢的话,欢迎大家给star。">
8989
<meta property="og:locale" content="zh-Hans">
90-
<meta property="og:image" content="http://yoursite.com/2019/01/04/安卓注解处理器-processor/框架流程.png">
91-
<meta property="og:image" content="http://yoursite.com/2019/01/04/安卓注解处理器-processor/annotation.png">
92-
<meta property="og:updated_time" content="2019-01-04T11:11:19.343Z">
90+
<meta property="og:image" content="http://yoursite.com/2019/01/04/安卓注解处理器-processor/D:/blog/source/_posts/%E5%AE%89%E5%8D%93%E6%B3%A8%E8%A7%A3%E5%A4%84%E7%90%86%E5%99%A8-processor/%E6%A1%86%E6%9E%B6%E6%B5%81%E7%A8%8B.png">
91+
<meta property="og:image" content="http://yoursite.com/2019/01/04/安卓注解处理器-processor/D:/blog/source/_posts/%E5%AE%89%E5%8D%93%E6%B3%A8%E8%A7%A3%E5%A4%84%E7%90%86%E5%99%A8-processor/annotation.png">
92+
<meta property="og:updated_time" content="2019-01-04T11:15:21.602Z">
9393
<meta name="twitter:card" content="summary">
94-
<meta name="twitter:title" content="夏勇的个人博客">
95-
<meta name="twitter:description" content="1234title: 安卓注解处理器-processordate: 2019-01-04 19:02:34tags: annotation、processor、自动生成java文件category: 注解 最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为https://github.com">
96-
<meta name="twitter:image" content="http://yoursite.com/2019/01/04/安卓注解处理器-processor/框架流程.png">
94+
<meta name="twitter:title" content="安卓注解处理器-processor">
95+
<meta name="twitter:description" content="最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为https://github.com/cugyong/AnnotationProcessor-sample ,如果喜欢的话,欢迎大家给star。">
96+
<meta name="twitter:image" content="http://yoursite.com/2019/01/04/安卓注解处理器-processor/D:/blog/source/_posts/%E5%AE%89%E5%8D%93%E6%B3%A8%E8%A7%A3%E5%A4%84%E7%90%86%E5%99%A8-processor/%E6%A1%86%E6%9E%B6%E6%B5%81%E7%A8%8B.png">
9797

9898

9999

@@ -129,7 +129,7 @@
129129

130130

131131

132-
<title> | 夏勇的个人博客</title>
132+
<title>安卓注解处理器-processor | 夏勇的个人博客</title>
133133

134134

135135

@@ -315,7 +315,7 @@
315315

316316

317317

318-
<h1 class="post-title" itemprop="name headline"></h1>
318+
<h1 class="post-title" itemprop="name headline">安卓注解处理器-processor</h1>
319319

320320

321321
<div class="post-meta">
@@ -327,7 +327,7 @@ <h1 class="post-title" itemprop="name headline"></h1>
327327

328328
<span class="post-meta-item-text">发表于</span>
329329

330-
<time title="创建于" itemprop="dateCreated datePublished" datetime="2019-01-04T18:29:09+08:00">
330+
<time title="创建于" itemprop="dateCreated datePublished" datetime="2019-01-04T19:12:12+08:00">
331331
2019-01-04
332332
</time>
333333

@@ -338,6 +338,28 @@ <h1 class="post-title" itemprop="name headline"></h1>
338338
</span>
339339

340340

341+
<span class="post-category">
342+
343+
<span class="post-meta-divider">|</span>
344+
345+
<span class="post-meta-item-icon">
346+
<i class="fa fa-folder-o"></i>
347+
</span>
348+
349+
<span class="post-meta-item-text">分类于</span>
350+
351+
352+
<span itemprop="about" itemscope="" itemtype="http://schema.org/Thing">
353+
<a href="/categories/注解/" itemprop="url" rel="index">
354+
<span itemprop="name">注解</span>
355+
</a>
356+
</span>
357+
358+
359+
360+
361+
</span>
362+
341363

342364

343365

@@ -370,10 +392,9 @@ <h1 class="post-title" itemprop="name headline"></h1>
370392

371393

372394

373-
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">title: 安卓注解处理器-processor</span><br><span class="line">date: 2019-01-04 19:02:34</span><br><span class="line">tags: annotation、processor、自动生成java文件</span><br><span class="line">category: 注解</span><br></pre></td></tr></table></figure>
374-
<p>最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为<a href="https://github.com/cugyong/AnnotationProcessor-sample" target="_blank" rel="noopener">https://github.com/cugyong/AnnotationProcessor-sample</a> ,如果喜欢的话,欢迎大家给star。<a id="more"></a></p>
395+
<p>最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为<a href="https://github.com/cugyong/AnnotationProcessor-sample" target="_blank" rel="noopener">https://github.com/cugyong/AnnotationProcessor-sample</a> ,如果喜欢的话,欢迎大家给star。<a id="more"></a></p>
375396
<h2 id="Demo需求描述"><a href="#Demo需求描述" class="headerlink" title="Demo需求描述"></a>Demo需求描述</h2><p>用户通过执行一个传入参数为A(类对象)的静态方法,该方法会最终把参数A中加了特定注解的所有方法执行一遍。</p>
376-
<h2 id="需求实现"><a href="#需求实现" class="headerlink" title="需求实现"></a>需求实现</h2><p><img src="/2019/01/04/安卓注解处理器-processor/框架流程.png" alt="框架流程"></p>
397+
<h2 id="需求实现"><a href="#需求实现" class="headerlink" title="需求实现"></a>需求实现</h2><p><img src="/2019/01/04/安卓注解处理器-processor/D:/blog/source/_posts/%E5%AE%89%E5%8D%93%E6%B3%A8%E8%A7%A3%E5%A4%84%E7%90%86%E5%99%A8-processor/%E6%A1%86%E6%9E%B6%E6%B5%81%E7%A8%8B.png" alt="框架流程"></p>
377398
<p>整个项目分为四个部分:</p>
378399
<ul>
379400
<li>注解–要使用的注解类型,这部分通常也可以放在lib中;</li>
@@ -383,7 +404,7 @@ <h2 id="需求实现"><a href="#需求实现" class="headerlink" title="需求
383404
</ul>
384405
<p>首先新建一个安卓工程,点击运行展示的是hello world。</p>
385406
<h3 id="注解"><a href="#注解" class="headerlink" title="注解"></a>注解</h3><p>在上述工程中new-&gt;Module-&gt;Java Library,新建一个Java Library Module,命名为annotation。在该Module下创建一个文件AnnotationTest.java,</p>
386-
<p><img src="/2019/01/04/安卓注解处理器-processor/annotation.png" alt="1546591844724"></p>
407+
<p><img src="/2019/01/04/安卓注解处理器-processor/D:/blog/source/_posts/%E5%AE%89%E5%8D%93%E6%B3%A8%E8%A7%A3%E5%A4%84%E7%90%86%E5%99%A8-processor/annotation.png" alt="1546591844724"></p>
387408
<p>AnnotationTest.java里面代码如下:</p>
388409
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@Retention(RetentionPolicy.CLASS)</span><br><span class="line">@Target(ElementType.METHOD)</span><br><span class="line">public @interface AnnotationTest &#123;</span><br><span class="line"> String name() default &quot;test&quot;;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
389410
<p>1、注解@Retention按生命周期来划分可分为3类:</p>
@@ -429,27 +450,17 @@ <h3 id="Lib"><a href="#Lib" class="headerlink" title="Lib"></a>Lib</h3><p>在工
429450

430451
<footer class="post-footer">
431452

432-
453+
<div class="post-tags">
454+
455+
<a href="/tags/annotation、processor、自动生成java文件/" rel="tag"># annotation、processor、自动生成java文件</a>
456+
457+
</div>
433458

459+
434460

435461

436-
437462

438-
<div class="post-nav">
439-
<div class="post-nav-next post-nav-item">
440-
441-
</div>
442463

443-
<span class="post-nav-divider"></span>
444-
445-
<div class="post-nav-prev post-nav-item">
446-
447-
<a href="/2019/01/04/test/" rel="prev" title="test">
448-
test <i class="fa fa-chevron-right"></i>
449-
</a>
450-
451-
</div>
452-
</div>
453464

454465

455466

@@ -525,15 +536,33 @@ <h3 id="Lib"><a href="#Lib" class="headerlink" title="Lib"></a>Lib</h3><p>在工
525536

526537
<a href="/archives/">
527538

528-
<span class="site-state-item-count">2</span>
539+
<span class="site-state-item-count">1</span>
529540
<span class="site-state-item-name">日志</span>
530541
</a>
531542
</div>
532543

533544

534545

546+
547+
548+
<div class="site-state-item site-state-categories">
549+
550+
<span class="site-state-item-count">1</span>
551+
<span class="site-state-item-name">分类</span>
552+
553+
</div>
554+
535555

536556

557+
558+
559+
<div class="site-state-item site-state-tags">
560+
561+
<span class="site-state-item-count">1</span>
562+
<span class="site-state-item-name">标签</span>
563+
564+
</div>
565+
537566

538567
</nav>
539568

‎about/index.html

+19-1
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,33 @@ <h1 class="post-title" itemprop="name headline">这是cugyong的个人博客</h1
360360

361361
<a href="/archives/">
362362

363-
<span class="site-state-item-count">2</span>
363+
<span class="site-state-item-count">1</span>
364364
<span class="site-state-item-name">日志</span>
365365
</a>
366366
</div>
367367

368368

369369

370+
371+
372+
<div class="site-state-item site-state-categories">
373+
374+
<span class="site-state-item-count">1</span>
375+
<span class="site-state-item-name">分类</span>
376+
377+
</div>
378+
370379

371380

381+
382+
383+
<div class="site-state-item site-state-tags">
384+
385+
<span class="site-state-item-count">1</span>
386+
<span class="site-state-item-name">标签</span>
387+
388+
</div>
389+
372390

373391
</nav>
374392

‎archives/2019/01/index.html

+22-39
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293

294294

295295

296-
嗯..! 目前共计 2 篇日志。 继续努力。
296+
嗯..! 目前共计 1 篇日志。 继续努力。
297297
</span>
298298

299299

@@ -312,56 +312,21 @@ <h1 class="archive-year" id="archive-year-2019">2019</h1>
312312

313313

314314

315-
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
316-
<header class="post-header">
317-
318-
<h2 class="post-title">
319-
320-
<a class="post-title-link" href="/2019/01/04/test/" itemprop="url">
321-
322-
<span itemprop="name">test</span>
323-
324-
</a>
325-
326-
</h2>
327-
328-
<div class="post-meta">
329-
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T19:12:12+08:00" content="2019-01-04">
330-
01-04
331-
</time>
332-
</div>
333-
334-
</header>
335-
</article>
336-
337-
338-
339-
340-
341-
342-
343-
344-
345-
346-
347-
348-
349-
350315
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
351316
<header class="post-header">
352317

353318
<h2 class="post-title">
354319

355320
<a class="post-title-link" href="/2019/01/04/安卓注解处理器-processor/" itemprop="url">
356321

357-
<span itemprop="name">未命名</span>
322+
<span itemprop="name">安卓注解处理器-processor</span>
358323

359324
</a>
360325

361326
</h2>
362327

363328
<div class="post-meta">
364-
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T18:29:09+08:00" content="2019-01-04">
329+
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T19:12:12+08:00" content="2019-01-04">
365330
01-04
366331
</time>
367332
</div>
@@ -426,15 +391,33 @@ <h2 class="post-title">
426391

427392
<a href="/archives/">
428393

429-
<span class="site-state-item-count">2</span>
394+
<span class="site-state-item-count">1</span>
430395
<span class="site-state-item-name">日志</span>
431396
</a>
432397
</div>
433398

434399

435400

401+
402+
403+
<div class="site-state-item site-state-categories">
404+
405+
<span class="site-state-item-count">1</span>
406+
<span class="site-state-item-name">分类</span>
407+
408+
</div>
409+
436410

437411

412+
413+
414+
<div class="site-state-item site-state-tags">
415+
416+
<span class="site-state-item-count">1</span>
417+
<span class="site-state-item-name">标签</span>
418+
419+
</div>
420+
438421

439422
</nav>
440423

‎archives/2019/index.html

+22-39
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293

294294

295295

296-
嗯..! 目前共计 2 篇日志。 继续努力。
296+
嗯..! 目前共计 1 篇日志。 继续努力。
297297
</span>
298298

299299

@@ -312,56 +312,21 @@ <h1 class="archive-year" id="archive-year-2019">2019</h1>
312312

313313

314314

315-
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
316-
<header class="post-header">
317-
318-
<h2 class="post-title">
319-
320-
<a class="post-title-link" href="/2019/01/04/test/" itemprop="url">
321-
322-
<span itemprop="name">test</span>
323-
324-
</a>
325-
326-
</h2>
327-
328-
<div class="post-meta">
329-
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T19:12:12+08:00" content="2019-01-04">
330-
01-04
331-
</time>
332-
</div>
333-
334-
</header>
335-
</article>
336-
337-
338-
339-
340-
341-
342-
343-
344-
345-
346-
347-
348-
349-
350315
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
351316
<header class="post-header">
352317

353318
<h2 class="post-title">
354319

355320
<a class="post-title-link" href="/2019/01/04/安卓注解处理器-processor/" itemprop="url">
356321

357-
<span itemprop="name">未命名</span>
322+
<span itemprop="name">安卓注解处理器-processor</span>
358323

359324
</a>
360325

361326
</h2>
362327

363328
<div class="post-meta">
364-
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T18:29:09+08:00" content="2019-01-04">
329+
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T19:12:12+08:00" content="2019-01-04">
365330
01-04
366331
</time>
367332
</div>
@@ -426,15 +391,33 @@ <h2 class="post-title">
426391

427392
<a href="/archives/">
428393

429-
<span class="site-state-item-count">2</span>
394+
<span class="site-state-item-count">1</span>
430395
<span class="site-state-item-name">日志</span>
431396
</a>
432397
</div>
433398

434399

435400

401+
402+
403+
<div class="site-state-item site-state-categories">
404+
405+
<span class="site-state-item-count">1</span>
406+
<span class="site-state-item-name">分类</span>
407+
408+
</div>
409+
436410

437411

412+
413+
414+
<div class="site-state-item site-state-tags">
415+
416+
<span class="site-state-item-count">1</span>
417+
<span class="site-state-item-name">标签</span>
418+
419+
</div>
420+
438421

439422
</nav>
440423

‎archives/index.html

+22-39
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293

294294

295295

296-
嗯..! 目前共计 2 篇日志。 继续努力。
296+
嗯..! 目前共计 1 篇日志。 继续努力。
297297
</span>
298298

299299

@@ -312,56 +312,21 @@ <h1 class="archive-year" id="archive-year-2019">2019</h1>
312312

313313

314314

315-
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
316-
<header class="post-header">
317-
318-
<h2 class="post-title">
319-
320-
<a class="post-title-link" href="/2019/01/04/test/" itemprop="url">
321-
322-
<span itemprop="name">test</span>
323-
324-
</a>
325-
326-
</h2>
327-
328-
<div class="post-meta">
329-
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T19:12:12+08:00" content="2019-01-04">
330-
01-04
331-
</time>
332-
</div>
333-
334-
</header>
335-
</article>
336-
337-
338-
339-
340-
341-
342-
343-
344-
345-
346-
347-
348-
349-
350315
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
351316
<header class="post-header">
352317

353318
<h2 class="post-title">
354319

355320
<a class="post-title-link" href="/2019/01/04/安卓注解处理器-processor/" itemprop="url">
356321

357-
<span itemprop="name">未命名</span>
322+
<span itemprop="name">安卓注解处理器-processor</span>
358323

359324
</a>
360325

361326
</h2>
362327

363328
<div class="post-meta">
364-
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T18:29:09+08:00" content="2019-01-04">
329+
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T19:12:12+08:00" content="2019-01-04">
365330
01-04
366331
</time>
367332
</div>
@@ -426,15 +391,33 @@ <h2 class="post-title">
426391

427392
<a href="/archives/">
428393

429-
<span class="site-state-item-count">2</span>
394+
<span class="site-state-item-count">1</span>
430395
<span class="site-state-item-name">日志</span>
431396
</a>
432397
</div>
433398

434399

435400

401+
402+
403+
<div class="site-state-item site-state-categories">
404+
405+
<span class="site-state-item-count">1</span>
406+
<span class="site-state-item-name">分类</span>
407+
408+
</div>
409+
436410

437411

412+
413+
414+
<div class="site-state-item site-state-tags">
415+
416+
<span class="site-state-item-count">1</span>
417+
<span class="site-state-item-name">标签</span>
418+
419+
</div>
420+
438421

439422
</nav>
440423

‎categories/index.html

+19-1
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,33 @@ <h1 class="post-title" itemprop="name headline">分类</h1>
360360

361361
<a href="/archives/">
362362

363-
<span class="site-state-item-count">2</span>
363+
<span class="site-state-item-count">1</span>
364364
<span class="site-state-item-name">日志</span>
365365
</a>
366366
</div>
367367

368368

369369

370+
371+
372+
<div class="site-state-item site-state-categories">
373+
374+
<span class="site-state-item-count">1</span>
375+
<span class="site-state-item-name">分类</span>
376+
377+
</div>
378+
370379

371380

381+
382+
383+
<div class="site-state-item site-state-tags">
384+
385+
<span class="site-state-item-count">1</span>
386+
<span class="site-state-item-name">标签</span>
387+
388+
</div>
389+
372390

373391
</nav>
374392

‎2019/01/04/test/index.html renamed to ‎categories/注解/index.html

+50-133
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,14 @@
8181

8282
<meta name="description" content="知耻而后勇,知弱而图强">
8383
<meta name="keywords" content="Android">
84-
<meta property="og:type" content="article">
85-
<meta property="og:title" content="test">
86-
<meta property="og:url" content="http://yoursite.com/2019/01/04/test/index.html">
84+
<meta property="og:type" content="website">
85+
<meta property="og:title" content="夏勇的个人博客">
86+
<meta property="og:url" content="http://yoursite.com/categories/注解/index.html">
8787
<meta property="og:site_name" content="夏勇的个人博客">
8888
<meta property="og:description" content="知耻而后勇,知弱而图强">
8989
<meta property="og:locale" content="zh-Hans">
90-
<meta property="og:updated_time" content="2019-01-04T11:12:12.843Z">
9190
<meta name="twitter:card" content="summary">
92-
<meta name="twitter:title" content="test">
91+
<meta name="twitter:title" content="夏勇的个人博客">
9392
<meta name="twitter:description" content="知耻而后勇,知弱而图强">
9493

9594

@@ -120,13 +119,13 @@
120119

121120

122121

123-
<link rel="canonical" href="http://yoursite.com/2019/01/04/test/">
122+
<link rel="canonical" href="http://yoursite.com/categories/注解/">
124123

125124

126125

127126

128127

129-
<title>test | 夏勇的个人博客</title>
128+
<title>分类: 注解 | 夏勇的个人博客</title>
130129

131130

132131

@@ -145,7 +144,7 @@
145144

146145

147146

148-
<div class="container sidebar-position-left page-post-detail">
147+
<div class="container sidebar-position-left ">
149148
<div class="headband"></div>
150149

151150
<header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
@@ -281,145 +280,53 @@
281280
<div id="content" class="content">
282281

283282

284-
<div id="posts" class="posts-expand">
285-
286-
287-
288-
289283

290284

291285

286+
<div class="post-block category">
292287

293-
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
294-
295-
296-
297-
<div class="post-block">
298-
<link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/01/04/test/">
299-
300-
<span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
301-
<meta itemprop="name" content="夏勇">
302-
<meta itemprop="description" content="">
303-
<meta itemprop="image" content="/images/head.jpg">
304-
</span>
288+
<div id="posts" class="posts-collapse">
289+
<div class="collection-title">
290+
<h1>注解<small>分类</small>
291+
</h1>
292+
</div>
305293

306-
<span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
307-
<meta itemprop="name" content="夏勇的个人博客">
308-
</span>
294+
295+
309296

310-
311-
<header class="post-header">
297+
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
298+
<header class="post-header">
312299

300+
<h2 class="post-title">
313301

314-
315-
<h1 class="post-title" itemprop="name headline">test</h1>
316-
317-
318-
<div class="post-meta">
319-
<span class="post-time">
320-
321-
<span class="post-meta-item-icon">
322-
<i class="fa fa-calendar-o"></i>
323-
</span>
302+
<a class="post-title-link" href="/2019/01/04/安卓注解处理器-processor/" itemprop="url">
324303

325-
<span class="post-meta-item-text">发表于</span>
304+
<span itemprop="name">安卓注解处理器-processor</span>
326305

327-
<time title="创建于" itemprop="dateCreated datePublished" datetime="2019-01-04T19:12:12+08:00">
328-
2019-01-04
329-
</time>
330-
331-
332-
333-
334-
335-
</span>
336-
337-
338-
339-
340-
341-
342-
343-
344-
345-
346-
347-
348-
349-
<span class="post-meta-divider">|</span>
350-
<span id="busuanzi_value_page_pv"></span>次阅读
351-
352-
353-
354-
355-
356-
357-
</div>
358-
</header>
359-
360-
361-
362-
363-
364-
<div class="post-body" itemprop="articleBody">
365-
366-
367-
368-
369-
306+
</a>
370307

371-
372-
</div>
373-
374-
375-
308+
</h2>
376309

377-
378-
379-
380-
381-
310+
<div class="post-meta">
311+
<time class="post-time" itemprop="dateCreated" datetime="2019-01-04T19:12:12+08:00" content="2019-01-04">
312+
01-04
313+
</time>
314+
</div>
382315

383-
<footer class="post-footer">
384-
316+
</header>
317+
</article>
385318

386-
387-
388-
389319

390320

391-
<div class="post-nav">
392-
<div class="post-nav-next post-nav-item">
393-
394-
<a href="/2019/01/04/安卓注解处理器-processor/" rel="next" title="">
395-
<i class="fa fa-chevron-left"></i>
396-
</a>
397-
398-
</div>
399-
400-
<span class="post-nav-divider"></span>
401-
402-
<div class="post-nav-prev post-nav-item">
403-
404-
</div>
405-
</div>
406-
321+
</div>
407322

408-
409-
410-
</footer>
411323
</div>
412324

413325

414326

415-
</article>
416-
417327

328+
418329

419-
<div class="post-spread">
420-
421-
</div>
422-
</div>
423330

424331

425332
</div>
@@ -428,10 +335,6 @@ <h1 class="post-title" itemprop="name headline">test</h1>
428335

429336

430337

431-
432-
433-
434-
435338
</div>
436339

437340

@@ -469,15 +372,33 @@ <h1 class="post-title" itemprop="name headline">test</h1>
469372

470373
<a href="/archives/">
471374

472-
<span class="site-state-item-count">2</span>
375+
<span class="site-state-item-count">1</span>
473376
<span class="site-state-item-name">日志</span>
474377
</a>
475378
</div>
476379

477380

478381

382+
383+
384+
<div class="site-state-item site-state-categories">
385+
386+
<span class="site-state-item-count">1</span>
387+
<span class="site-state-item-name">分类</span>
388+
389+
</div>
390+
479391

480392

393+
394+
395+
<div class="site-state-item site-state-tags">
396+
397+
<span class="site-state-item-count">1</span>
398+
<span class="site-state-item-name">标签</span>
399+
400+
</div>
401+
481402

482403
</nav>
483404

@@ -649,10 +570,6 @@ <h1 class="post-title" itemprop="name headline">test</h1>
649570

650571

651572

652-
<script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
653-
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>
654-
655-
656573

657574

658575

‎index.html

+36-118
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295

296296

297297
<div class="post-block">
298-
<link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/01/04/test/">
298+
<link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/01/04/安卓注解处理器-processor/">
299299

300300
<span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
301301
<meta itemprop="name" content="夏勇">
@@ -314,7 +314,7 @@
314314

315315
<h1 class="post-title" itemprop="name headline">
316316

317-
<a class="post-title-link" href="/2019/01/04/test/" itemprop="url">test</a></h1>
317+
<a class="post-title-link" href="/2019/01/04/安卓注解处理器-processor/" itemprop="url">安卓注解处理器-processor</a></h1>
318318

319319

320320
<div class="post-meta">
@@ -337,126 +337,27 @@ <h1 class="post-title" itemprop="name headline">
337337
</span>
338338

339339

340-
341-
342-
343-
344-
345-
346-
347-
348-
349-
350-
351-
352-
353-
354-
355-
356-
</div>
357-
</header>
358-
359-
360-
361-
362-
363-
<div class="post-body" itemprop="articleBody">
364-
365-
366-
367-
368-
369-
370-
340+
<span class="post-category">
371341

372-
373-
374-
375-
</div>
376-
377-
378-
379-
380-
381-
382-
383-
384-
385-
386-
<footer class="post-footer">
387-
388-
389-
390-
391-
392-
393-
394-
395-
<div class="post-eof"></div>
396-
397-
</footer>
398-
</div>
399-
400-
401-
402-
</article>
403-
404-
405-
406-
407-
408-
409-
410-
411-
412-
413-
414-
<article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
415-
416-
417-
418-
<div class="post-block">
419-
<link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/01/04/安卓注解处理器-processor/">
420-
421-
<span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
422-
<meta itemprop="name" content="夏勇">
423-
<meta itemprop="description" content="">
424-
<meta itemprop="image" content="/images/head.jpg">
425-
</span>
426-
427-
<span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
428-
<meta itemprop="name" content="夏勇的个人博客">
429-
</span>
430-
431-
432-
<header class="post-header">
433-
434-
435-
436-
<h1 class="post-title" itemprop="name headline">
437-
438-
<a class="post-title-link" href="/2019/01/04/安卓注解处理器-processor/" itemprop="url">未命名</a></h1>
439-
440-
441-
<div class="post-meta">
442-
<span class="post-time">
342+
<span class="post-meta-divider">|</span>
443343

444344
<span class="post-meta-item-icon">
445-
<i class="fa fa-calendar-o"></i>
345+
<i class="fa fa-folder-o"></i>
446346
</span>
447347

448-
<span class="post-meta-item-text">发表于</span>
348+
<span class="post-meta-item-text">分类于</span>
449349

450-
<time title="创建于" itemprop="dateCreated datePublished" datetime="2019-01-04T18:29:09+08:00">
451-
2019-01-04
452-
</time>
453-
454-
455-
456-
457-
458-
</span>
350+
351+
<span itemprop="about" itemscope="" itemtype="http://schema.org/Thing">
352+
<a href="/categories/注解/" itemprop="url" rel="index">
353+
<span itemprop="name">注解</span>
354+
</a>
355+
</span>
459356

357+
358+
359+
360+
</span>
460361

461362

462363

@@ -488,8 +389,7 @@ <h1 class="post-title" itemprop="name headline">
488389

489390

490391

491-
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">title: 安卓注解处理器-processor</span><br><span class="line">date: 2019-01-04 19:02:34</span><br><span class="line">tags: annotation、processor、自动生成java文件</span><br><span class="line">category: 注解</span><br></pre></td></tr></table></figure>
492-
<p>最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为<a href="https://github.com/cugyong/AnnotationProcessor-sample" target="_blank" rel="noopener">https://github.com/cugyong/AnnotationProcessor-sample</a> ,如果喜欢的话,欢迎大家给star。</p>
392+
<p>最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为<a href="https://github.com/cugyong/AnnotationProcessor-sample" target="_blank" rel="noopener">https://github.com/cugyong/AnnotationProcessor-sample</a> ,如果喜欢的话,欢迎大家给star。</p>
493393
<!--noindex-->
494394
<div class="post-button text-center">
495395
<a class="btn" href="/2019/01/04/安卓注解处理器-processor/#more" rel="contents">
@@ -578,15 +478,33 @@ <h1 class="post-title" itemprop="name headline">
578478

579479
<a href="/archives/">
580480

581-
<span class="site-state-item-count">2</span>
481+
<span class="site-state-item-count">1</span>
582482
<span class="site-state-item-name">日志</span>
583483
</a>
584484
</div>
585485

586486

587487

488+
489+
490+
<div class="site-state-item site-state-categories">
491+
492+
<span class="site-state-item-count">1</span>
493+
<span class="site-state-item-name">分类</span>
494+
495+
</div>
496+
588497

589498

499+
500+
501+
<div class="site-state-item site-state-tags">
502+
503+
<span class="site-state-item-count">1</span>
504+
<span class="site-state-item-name">标签</span>
505+
506+
</div>
507+
590508

591509
</nav>
592510

‎search.xml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<search>
33
<entry>
4-
<title><![CDATA[test]]></title>
5-
<url>%2F2019%2F01%2F04%2Ftest%2F</url>
6-
<content type="text"></content>
7-
</entry>
8-
<entry>
9-
<title></title>
4+
<title><![CDATA[安卓注解处理器-processor]]></title>
105
<url>%2F2019%2F01%2F04%2F%E5%AE%89%E5%8D%93%E6%B3%A8%E8%A7%A3%E5%A4%84%E7%90%86%E5%99%A8-processor%2F</url>
11-
<content type="text"><![CDATA[1234title: 安卓注解处理器-processordate: 2019-01-04 19:02:34tags: annotation、processor、自动生成java文件category: 注解 最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为https://github.com/cugyong/AnnotationProcessor-sample ,如果喜欢的话,欢迎大家给star。 Demo需求描述用户通过执行一个传入参数为A(类对象)的静态方法,该方法会最终把参数A中加了特定注解的所有方法执行一遍。 需求实现 整个项目分为四个部分: 注解–要使用的注解类型,这部分通常也可以放在lib中; 注解处理器–要对注解进行处理的逻辑,包括收集有特定注解类型的方法信息以及生成特定的java文件; lib–封装合适的接口,供具体调用方调用; sample–具体的调用方逻辑。 首先新建一个安卓工程,点击运行展示的是hello world。 注解在上述工程中new-&gt;Module-&gt;Java Library,新建一个Java Library Module,命名为annotation。在该Module下创建一个文件AnnotationTest.java, AnnotationTest.java里面代码如下: 12345@Retention(RetentionPolicy.CLASS)@Target(ElementType.METHOD)public @interface AnnotationTest &#123; String name() default &quot;test&quot;;&#125; 1、注解@Retention按生命周期来划分可分为3类: RetentionPolicy.SOURCE:注解只保留在源文件,当Java文件编译成class文件的时候,注解被遗弃; RetentionPolicy.CLASS:注解被保留到class文件,当jvm加载class文件时候被遗弃,这是默认的生命周期; RetentionPolicy.RUNTIME:注解不仅被保存到class文件中,jvm加载class文件之后,仍然存在。 这3个生命周期分别对应于:Java源文件(.java文件) —&gt; .class文件 —&gt; 内存中的字节码。 2、注解@Target表示修饰的注解能使用的范围,ElementType.METHOD表示@AnnotationTest注解只能作用在方法上。 注解处理器参照上部分,在工程中new-&gt;Module-&gt;Java Library,新建一个Java Library Module, 在该Module下创建一个文件ProcessorTest.java。在该Module下的build.gradle的dependencies中添加如下配置: 1234// 自动为processor注册implementation &apos;com.google.auto.service:auto-service:1.0-rc2&apos;// 该Module依赖上部分建立的annotation Moduleimplementation project(&apos;:annotation&apos;) com.google.auto.service:auto-service:1.0-rc2依赖的作用是为注解处理器自动注册,它会生成META-INF文件夹。 注解处理器ProcessorTest的定义如下,其中@AutoService(Processor.class)就是build.gradle中加的依赖帮助其自动注册。 12@AutoService(Processor.class) // 自动为ProcessorTest注册,生成META-INF文件public class ProcessorTest extends AbstractProcessor&#123; 注解处理器ProcessorTest主要包含以下几个部分: 1234567@Overridepublic synchronized void init(ProcessingEnvironment processingEnvironment) &#123; super.init(processingEnvironment); mMessager = processingEnvironment.getMessager(); mFiler = processingEnvironment.getFiler();&#125; init方法是注解处理器会自动调用的初始化方法,其中mFiler是用来生成java源文件的工具,mMessager是用来打印日志的,它们的具体使用会在后面介绍。 123456@Overridepublic Set&lt;String&gt; getSupportedAnnotationTypes() &#123; Set&lt;String&gt; supportAnnotationTypes = new HashSet&lt;&gt;(); supportAnnotationTypes.add(AnnotationTest.class.getCanonicalName()); return supportAnnotationTypes;&#125; getSupportedAnnotationTypes()方法返回该注解处理器支持的注解类型,这里返回的就是我们之前声明的新的注解类型@AnnotationTest。 1234@Overridepublic SourceVersion getSupportedSourceVersion() &#123; return SourceVersion.latestSupported();&#125; getSupportedSourceVersion()方法一般就按照上述实现就行。 1234567891011121314151617181920212223242526272829303132333435363738@Overridepublic boolean process(Set&lt;? extends TypeElement&gt; annotations, RoundEnvironment roundEnvironment) &#123; // 打印日志 mMessager.printMessage(Diagnostic.Kind.NOTE, &quot;process start&quot;); Map&lt;String, List&lt;String&gt;&gt; collectInfos = new HashMap&lt;&gt;(); for (TypeElement annotation: annotations)&#123; Set&lt;? extends Element&gt; elements = roundEnvironment.getElementsAnnotatedWith(annotation); for (Element element: elements)&#123; // 检查element是否符合我们定义的规范 if (!checkValid(element))&#123; mMessager.printMessage(Diagnostic.Kind.NOTE, &quot;checkValid not pass&quot;); return false; &#125;else &#123; ExecutableElement executableElement = (ExecutableElement) element; // 获取被注解的方法所在的类 TypeElement typeElement = (TypeElement) executableElement.getEnclosingElement(); // 获取类的全名,包括包名 String classFullName = typeElement.getQualifiedName().toString(); // 被注解的方法的名字 String methodName = executableElement.getSimpleName().toString(); List&lt;String&gt; methods = collectInfos.get(classFullName); if (methods == null)&#123; methods = new ArrayList&lt;&gt;(); collectInfos.put(classFullName, methods); &#125; methods.add(methodName); &#125; &#125; &#125; for (Map.Entry&lt;String, List&lt;String&gt;&gt; entry: collectInfos.entrySet())&#123; mMessager.printMessage(Diagnostic.Kind.NOTE, entry.getKey()); // 生成java源文件 createJavaFile(entry.getKey(), entry.getValue()); &#125; return true;&#125; process方法是我们的主要逻辑处理的地方,主要逻辑就是收集所有有@AnnotationTest注解的方法以及其所在的类信息,然后根据每个类信息,生成一个新的类文件,并在新的类文件的特定方法中调用所有关联的注解方法。生成java源文件将使用Filer对象,具体如何使用请下载demo看源代码。 注: 1、当你点击buid project时,注解处理器将会执行,而Messager对象打印出来的日志信息可以在Gradle Console窗口中看到。 2、如果你在该Module中使用中文注解,因为该Module为java library,可能会报GBK编码错误,解决办法是在该Module的build.gradle中添加如下代码: 1234//指定编译的编码tasks.withType(JavaCompile)&#123; options.encoding = &quot;UTF-8&quot;&#125; Lib在工程中new-&gt;Module-&gt;Android Library ,新建一个Android Library Module,封装接口给调用方使用,具体逻辑请参考demo。 最终该demo的功能是点击Hello world文字,会依此执行MainActivity中使用@AnnotationTest注解的方法。]]></content>
6+
<content type="text"><![CDATA[最近在学习安卓开源框架发现,很多的开源框架都使用到了注解处理器,例如EventBus3.0。本文通过一个简单的Demo来介绍如何使用注解处理器。Demo链接为https://github.com/cugyong/AnnotationProcessor-sample ,如果喜欢的话,欢迎大家给star。 Demo需求描述用户通过执行一个传入参数为A(类对象)的静态方法,该方法会最终把参数A中加了特定注解的所有方法执行一遍。 需求实现 整个项目分为四个部分: 注解–要使用的注解类型,这部分通常也可以放在lib中; 注解处理器–要对注解进行处理的逻辑,包括收集有特定注解类型的方法信息以及生成特定的java文件; lib–封装合适的接口,供具体调用方调用; sample–具体的调用方逻辑。 首先新建一个安卓工程,点击运行展示的是hello world。 注解在上述工程中new-&gt;Module-&gt;Java Library,新建一个Java Library Module,命名为annotation。在该Module下创建一个文件AnnotationTest.java, AnnotationTest.java里面代码如下: 12345@Retention(RetentionPolicy.CLASS)@Target(ElementType.METHOD)public @interface AnnotationTest &#123; String name() default &quot;test&quot;;&#125; 1、注解@Retention按生命周期来划分可分为3类: RetentionPolicy.SOURCE:注解只保留在源文件,当Java文件编译成class文件的时候,注解被遗弃; RetentionPolicy.CLASS:注解被保留到class文件,当jvm加载class文件时候被遗弃,这是默认的生命周期; RetentionPolicy.RUNTIME:注解不仅被保存到class文件中,jvm加载class文件之后,仍然存在。 这3个生命周期分别对应于:Java源文件(.java文件) —&gt; .class文件 —&gt; 内存中的字节码。 2、注解@Target表示修饰的注解能使用的范围,ElementType.METHOD表示@AnnotationTest注解只能作用在方法上。 注解处理器参照上部分,在工程中new-&gt;Module-&gt;Java Library,新建一个Java Library Module, 在该Module下创建一个文件ProcessorTest.java。在该Module下的build.gradle的dependencies中添加如下配置: 1234// 自动为processor注册implementation &apos;com.google.auto.service:auto-service:1.0-rc2&apos;// 该Module依赖上部分建立的annotation Moduleimplementation project(&apos;:annotation&apos;) com.google.auto.service:auto-service:1.0-rc2依赖的作用是为注解处理器自动注册,它会生成META-INF文件夹。 注解处理器ProcessorTest的定义如下,其中@AutoService(Processor.class)就是build.gradle中加的依赖帮助其自动注册。 12@AutoService(Processor.class) // 自动为ProcessorTest注册,生成META-INF文件public class ProcessorTest extends AbstractProcessor&#123; 注解处理器ProcessorTest主要包含以下几个部分: 1234567@Overridepublic synchronized void init(ProcessingEnvironment processingEnvironment) &#123; super.init(processingEnvironment); mMessager = processingEnvironment.getMessager(); mFiler = processingEnvironment.getFiler();&#125; init方法是注解处理器会自动调用的初始化方法,其中mFiler是用来生成java源文件的工具,mMessager是用来打印日志的,它们的具体使用会在后面介绍。 123456@Overridepublic Set&lt;String&gt; getSupportedAnnotationTypes() &#123; Set&lt;String&gt; supportAnnotationTypes = new HashSet&lt;&gt;(); supportAnnotationTypes.add(AnnotationTest.class.getCanonicalName()); return supportAnnotationTypes;&#125; getSupportedAnnotationTypes()方法返回该注解处理器支持的注解类型,这里返回的就是我们之前声明的新的注解类型@AnnotationTest。 1234@Overridepublic SourceVersion getSupportedSourceVersion() &#123; return SourceVersion.latestSupported();&#125; getSupportedSourceVersion()方法一般就按照上述实现就行。 1234567891011121314151617181920212223242526272829303132333435363738@Overridepublic boolean process(Set&lt;? extends TypeElement&gt; annotations, RoundEnvironment roundEnvironment) &#123; // 打印日志 mMessager.printMessage(Diagnostic.Kind.NOTE, &quot;process start&quot;); Map&lt;String, List&lt;String&gt;&gt; collectInfos = new HashMap&lt;&gt;(); for (TypeElement annotation: annotations)&#123; Set&lt;? extends Element&gt; elements = roundEnvironment.getElementsAnnotatedWith(annotation); for (Element element: elements)&#123; // 检查element是否符合我们定义的规范 if (!checkValid(element))&#123; mMessager.printMessage(Diagnostic.Kind.NOTE, &quot;checkValid not pass&quot;); return false; &#125;else &#123; ExecutableElement executableElement = (ExecutableElement) element; // 获取被注解的方法所在的类 TypeElement typeElement = (TypeElement) executableElement.getEnclosingElement(); // 获取类的全名,包括包名 String classFullName = typeElement.getQualifiedName().toString(); // 被注解的方法的名字 String methodName = executableElement.getSimpleName().toString(); List&lt;String&gt; methods = collectInfos.get(classFullName); if (methods == null)&#123; methods = new ArrayList&lt;&gt;(); collectInfos.put(classFullName, methods); &#125; methods.add(methodName); &#125; &#125; &#125; for (Map.Entry&lt;String, List&lt;String&gt;&gt; entry: collectInfos.entrySet())&#123; mMessager.printMessage(Diagnostic.Kind.NOTE, entry.getKey()); // 生成java源文件 createJavaFile(entry.getKey(), entry.getValue()); &#125; return true;&#125; process方法是我们的主要逻辑处理的地方,主要逻辑就是收集所有有@AnnotationTest注解的方法以及其所在的类信息,然后根据每个类信息,生成一个新的类文件,并在新的类文件的特定方法中调用所有关联的注解方法。生成java源文件将使用Filer对象,具体如何使用请下载demo看源代码。 注: 1、当你点击buid project时,注解处理器将会执行,而Messager对象打印出来的日志信息可以在Gradle Console窗口中看到。 2、如果你在该Module中使用中文注解,因为该Module为java library,可能会报GBK编码错误,解决办法是在该Module的build.gradle中添加如下代码: 1234//指定编译的编码tasks.withType(JavaCompile)&#123; options.encoding = &quot;UTF-8&quot;&#125; Lib在工程中new-&gt;Module-&gt;Android Library ,新建一个Android Library Module,封装接口给调用方使用,具体逻辑请参考demo。 最终该demo的功能是点击Hello world文字,会依此执行MainActivity中使用@AnnotationTest注解的方法。]]></content>
7+
<categories>
8+
<category>注解</category>
9+
</categories>
10+
<tags>
11+
<tag>annotation、processor、自动生成java文件</tag>
12+
</tags>
1213
</entry>
1314
</search>

‎tags/annotation、processor、自动生成java文件/index.html

+952
Large diffs are not rendered by default.

‎tags/index.html

+19-1
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,33 @@ <h1 class="post-title" itemprop="name headline">标签</h1>
360360

361361
<a href="/archives/">
362362

363-
<span class="site-state-item-count">2</span>
363+
<span class="site-state-item-count">1</span>
364364
<span class="site-state-item-name">日志</span>
365365
</a>
366366
</div>
367367

368368

369369

370+
371+
372+
<div class="site-state-item site-state-categories">
373+
374+
<span class="site-state-item-count">1</span>
375+
<span class="site-state-item-name">分类</span>
376+
377+
</div>
378+
370379

371380

381+
382+
383+
<div class="site-state-item site-state-tags">
384+
385+
<span class="site-state-item-count">1</span>
386+
<span class="site-state-item-name">标签</span>
387+
388+
</div>
389+
372390

373391
</nav>
374392

0 commit comments

Comments
 (0)
Please sign in to comment.